Fix suggested by Michael Tacelosky into the phpwizard forum

This commit is contained in:
Loïc Chapeaux
2001-07-07 12:37:15 +00:00
parent 2931a811cf
commit 54522e16c7
2 changed files with 14 additions and 8 deletions

View File

@@ -8,7 +8,9 @@ $Source$
2001-07-07 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-07-07 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* left.php3: improved the css. * left.php3: improved the css.
* left.js: try to "fix" the Opera and Konqueror bug (bad DOM implemenation * left.js: try to "fix" the Opera and Konqueror bug (bad DOM implemenation
-> list is no long expandable/collapsible with this browsers) -> list is no long expandable/collapsible with this browsers).
* sql.php3, lines 85-93: fix suggested by
Michael Tacelosky <tac@smokescreen.org> into the phpwizard forum.
2001-07-06 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-07-06 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* users_details.php3: fixed many little scripting bugs. * users_details.php3: fixed many little scripting bugs.

View File

@@ -79,14 +79,18 @@ else {
$result = mysql_query($sql_query.$sql_order.$sql_limit); $result = mysql_query($sql_query.$sql_order.$sql_limit);
// the same SELECT without LIMIT // the same SELECT without LIMIT
if(eregi("^SELECT", $sql_query)) if (eregi("^SELECT", $sql_query))
{ {
$array=split(' from | FROM ',$sql_query,2); //read only the from-part of the query $array = split(' from | FROM ',$sql_query,2); //read only the from-part of the query
$count_query="select count(*) as count from $array[1]"; //and make a count(*) to count the entries if (!empty(trim($array[1]))) {
$count_query = "select count(*) as count from $array[1]"; //and make a count(*) to count the entries
$OPresult = mysql_query($count_query); $OPresult = mysql_query($count_query);
if ($OPresult) { if ($OPresult) {
$SelectNumRows = mysql_result($OPresult,'0','count'); $SelectNumRows = mysql_result($OPresult,'0','count');
} }
} else {
$SelectNumRows = 0;
}
} }
if(!$result) if(!$result)