Fixed the reason for a waring

This commit is contained in:
Loïc Chapeaux
2001-05-20 18:13:53 +00:00
parent dfa57ed7d8
commit 3001b6dded

View File

@@ -449,9 +449,9 @@ function get_table_def($db, $table, $crlf)
$result = mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die();
while($row = mysql_fetch_array($result))
{
$kname=$row['Key_name'];
$comment=$row['Comment'];
$sub_part=$row['Sub_part'];
$kname=$row['Key_name'];
$comment=(isset($row['Comment'])) ? $row['Comment'] : '';
$sub_part=(isset($row['Sub_part'])) ? $row['Sub_part'] : '';
if(($kname != "PRIMARY") && ($row['Non_unique'] == 0))
$kname="UNIQUE|$kname";
@@ -678,13 +678,16 @@ function split_sql_file($sql, $delimiter) {
}
// Remove # type remarks from large sql files
// Version 2 18th May 2001 - Last Modified By Pete Kelly
// Version 3 20th May 2001 - Last Modified By Pete Kelly
function remove_remarks($sql) {
$i = 0;
while($i < strlen($sql)) {
if($sql[$i] == "#" and ($sql[$i-1] == "\n" or $i==0)) {
while ($i < strlen($sql)) {
if ($sql[$i] == "#" and ($sql[$i-1] == "\n" or $i==0)) {
$j=1;
while($sql[$i+$j] != "\n") $j++;
while ($sql[$i+$j] != "\n") {
$j++;
if ($j+$i > strlen($sql)) break;
}
$sql = substr($sql,0,$i) . substr($sql,$i+$j);
}
$i++;
@@ -693,6 +696,7 @@ function remove_remarks($sql) {
}
// Bookmark Support
function get_bookmarks_param() {
global $cfgServers;