Fixed a warning thanks to Svetlio Kovachev

This commit is contained in:
Loïc Chapeaux
2002-05-26 11:18:48 +00:00
parent 3d7942a0ef
commit e91b5dc62a
2 changed files with 19 additions and 14 deletions

View File

@@ -8,6 +8,10 @@ $Source$
2002-05-26 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* scripts/create-release.sh, line 60: added the "-P" option (prune empty
directory) for the cvs checkout.
* sql.php3:
- fixed a warning thanks to
Svetlio Kovachev <svetlio at users.sourceforge.net>;
- coding standards.
2002-05-25 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/common.lib.php3:

View File

@@ -1,6 +1,7 @@
<?php
/* $Id$ */
/**
* Gets some core libraries
*/
@@ -24,14 +25,14 @@ if (!empty($goto)) {
if (empty($goto)) {
$goto = (empty($table)) ? 'db_details.php3' : 'tbl_properties.php3';
$is_gotofile = TRUE;
}
} // end if
if (!isset($err_url)) {
$err_url = (!empty($back) ? $back : $goto)
. '?lang=' . $lang
. '&amp;server=' . $server
. (isset($db) ? '&amp;db=' . urlencode($db) : '')
. ((strpos(' ' . $goto, 'db_details') != 1 && isset($table)) ? '&amp;table=' . urlencode($table) : '');
}
} // end if
/**
@@ -65,7 +66,7 @@ if (isset($store_bkm)) {
include('./libraries/bookmark.lib.php3');
PMA_addBookmarks($fields, $cfg['Bookmark']);
header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
}
} // end if
/**
@@ -110,7 +111,7 @@ if ($goto == 'sql.php3') {
. '&amp;table=' . urlencode($table)
. '&amp;pos=' . $pos
. '&amp;sql_query=' . urlencode($sql_query);
}
} // end if
/**
@@ -253,13 +254,13 @@ else {
if ($is_delete
&& eregi('^DELETE([[:space:]].+)?([[:space:]]FROM[[:space:]](.+))$', $sql_query, $parts)
&& !eregi('[[:space:]]WHERE[[:space:]]', $parts[3])) {
$OPresult = @mysql_query('SELECT COUNT(*) as count' . $parts[2]);
if ($OPresult) {
$num_rows = mysql_result($OPresult, 0, 'count');
$cnt_all_result = @mysql_query('SELECT COUNT(*) as count' . $parts[2]);
if ($cnt_all_result) {
$num_rows = mysql_result($cnt_all_result, 0, 'count');
mysql_free_result($cnt_all_result);
} else {
$num_rows = 0;
}
mysql_free_result($OPresult);
}
// Executes the query
@@ -306,11 +307,11 @@ else {
if (!empty($array[1])) {
// ... and makes a count(*) to count the entries
$count_query = 'SELECT COUNT(*) AS count FROM ' . $array[1];
$OPresult = mysql_query($count_query);
if ($OPresult) {
$unlim_num_rows = mysql_result($OPresult, 0, 'count');
$cnt_all_result = mysql_query($count_query);
if ($cnt_all_result) {
$unlim_num_rows = mysql_result($cnt_all_result, 0, 'count');
mysql_free_result($cnt_all_result);
}
mysql_free_result($OPresult);
} else {
$unlim_num_rows = 0;
}