Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL
Author Message
tess333
New Member
New Member



Joined: Oct 23, 2003
Posts: 5

PostPosted: Sun Jun 13, 2004 3:54 pm Reply with quote

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
www.TheKidConnection.com

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;;
}
}

?>
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Jun 13, 2004 4:41 pm Reply with quote

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.
 
View user's profile Send private message
tess333







PostPosted: Mon Jun 14, 2004 7:16 am Reply with quote

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:


Only registered users can see links on this board! Get registered or login!

Thanks again
-t
Only registered users can see links on this board! Get registered or login!
 
Raven







PostPosted: Mon Jun 14, 2004 7:24 am Reply with quote

Yep, it looks like a couple tables may have gotten corrupted. Use phpMyAdmin and do a REPAIR on your database Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©