Fix suggested by Michael Tacelosky into the phpwizard forum
This commit is contained in:
@@ -8,7 +8,9 @@ $Source$
|
||||
2001-07-07 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* left.php3: improved the css.
|
||||
* 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>
|
||||
* users_details.php3: fixed many little scripting bugs.
|
||||
|
18
sql.php3
18
sql.php3
@@ -79,14 +79,18 @@ else {
|
||||
$result = mysql_query($sql_query.$sql_order.$sql_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
|
||||
$count_query="select count(*) as count from $array[1]"; //and make a count(*) to count the entries
|
||||
$OPresult = mysql_query($count_query);
|
||||
if ($OPresult) {
|
||||
$SelectNumRows = mysql_result($OPresult,'0','count');
|
||||
}
|
||||
$array = split(' from | FROM ',$sql_query,2); //read only the from-part of the query
|
||||
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);
|
||||
if ($OPresult) {
|
||||
$SelectNumRows = mysql_result($OPresult,'0','count');
|
||||
}
|
||||
} else {
|
||||
$SelectNumRows = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$result)
|
||||
|
Reference in New Issue
Block a user