| Author |
Message |
tess333 New Member


Joined: Oct 23, 2003 Posts: 5
|
Posted:
Sun Jun 13, 2004 3:54 pm |
|
The following two errors appreared on my site after the server went down.
I have tried to use the sql debuggers but they don't seem to work on my 5.6 version ( I know, I need to upgrade). I have also tried changing $sql_debug = 0; to $sql_debug = 1; but can't make heads or tails of it.
They are at the top of every page:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/data.default/kidconnection/includes/sql_layer.php on line 238
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/local/www/data.default/kidconnection/includes/sql_layer.php on line 494
Has anyone seen this before? I'd appreicate any help, Thanks
Context of sql_layer.php file for each line is below:
Line 238:
* sql_num_rows($res)
* given a result identifier, returns the number of affected rows
*/
function sql_num_rows($res)
{
global $dbtype;
switch ($dbtype) {
case "MySQL":
$rows=mysql_num_rows($res); <! Line 238 return $rows;
break;;
case "mSQL":
$rows=msql_num_rows($res);
return $rows;
break;;
case "PostgreSQL":
case "PostgreSQL_local":
$rows=pg_numrows( $res->get_result() );
return $rows;
break;;
case "ODBC":
case "ODBC_Adabas":
$rows=odbc_num_rows($res);
return $rows;
break;;
case "Interbase":
echo "<BR>Error! PHP dosen't support ibase_numrows!<BR>";
return $rows;
break;;
case "Sybase":
$rows=sybase_num_rows($res);
return $rows;
break;;
default:
break;;
}
and for line 394:
/*** Function Free Result for function free the memory ***/
function sql_free_result($res) {
global $dbtype;
switch ($dbtype) {
<! line 494
case "MySQL":
$row = mysql_free_result($res);
return $row;
break;;
case "mSQL":
$row = msql_free_result($res);
return $row;
break;;
case "PostgreSQL":
case "PostgreSQL_local":
$rows=pg_FreeResult( $res->get_result() );
return $rows;
break;;
case "ODBC":
case "ODBC_Adabas":
$rows=odbc_free_result($res);
return $rows;
break;;
case "Interbase":
echo "<BR>Error! PHP dosen't support ibase_numrows!<BR>";
return $rows;
break;;
case "Sybase":
$rows=sybase_free_result($res);
return $rows;
break;;
}
}
?> |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sun Jun 13, 2004 4:41 pm |
|
You need to set $sql_debug=1. Then, when you see the error mentioned above you will also see what block/module is causing the error. If you still can't determine which is causing it, leave the debug set to one so we can look at it and tell you which one is causing it. |
|
|
|
 |
tess333 New Member


Joined: Oct 23, 2003 Posts: 5
|
Posted:
Mon Jun 14, 2004 7:16 am |
|
I ran the debug=1 on my homepage and have taken screen captures - as I don't want to leave my readers unable to access infrmation.
Seems to have something to do with the Stats module but I can't find it.
I have posted screen capture of the debug=1 here:
Thanks again
-t
|
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Mon Jun 14, 2004 7:24 am |
|
Yep, it looks like a couple tables may have gotten corrupted. Use phpMyAdmin and do a REPAIR on your database  |
|
|
|
 |
|
|
|
|