Jump to content

more simple question


zsxdcfv21

Recommended Posts

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/mywebsitehere/httpdocs/lib.classes/class.MySQL.php on line 132

130 function resultHasRows ()
131 {
132 $numRows = mysql_num_rows( $this->resultResource );
133 if ( $numRows == 0 ) return false;
134 return true;
135 }


what are the possible things why it give out a warning???
Link to comment
Share on other sites

this is the other script where i could find the resultHasRows() function from the problem above

function trackUser()
{
global $db;
if ( @ isset($_SESSION['EventID']) ) {
// check for session expiry...
$db->setQuery('SELECT EventID FROM SystemUsage WHERE LastPage < DATE_SUB(NOW(), INTERVAL 15 MINUTE) AND EventID = '. (int)$_SESSION['EventID']);
$db->execute();
// expired! bad javascript no workie
if ( $db->resultHasRows() ) {
// set sessionedit
$db->setQuery('UPDATE SystemUsage SET SessionEND = NOW() WHERE EventID = ' . (int)$_SESSION['EventID']);
$db->execute();
// log them out!
session_destroy();
header('Location: index.php?expired=1');
exit();
}
// otherwise hit the last page!
$db->setQuery('UPDATE SystemUsage SET LastPage = NOW() WHERE EventID = ' . (int)$_SESSION['EventID']);
$db->execute();
} else {
// or.. start a new tracking session...
$UserAgent = $_SERVER['HTTP_USER_AGENT'];
$RemoteAddr = $_SERVER['REMOTE_ADDR'];
$db->setQuery('INSERT INTO SystemUsage (UserID, SessionStart, LastPage, UserAgent, RemoteAddr)');
$db->setQuery(" VALUES (" . (int)$_SESSION['UserID'] . ", NOW(), NOW(), '$UserAgent', '$RemoteAddr')");
$db->execute();
$db->setQuery('SELECT LAST_INSERT_ID() EventID');
$row = $db->executeOrDie();
$_SESSION['EventID'] = $row->EventID;
}
}


wc part do you think has a problem? and if ever theres nothing wrong on that part, is there anyway that i could take out the warning message??? coz as soon as i view this link http://mywebsitehere/app/buyer.php?action=notes&BuyerID=1068, it has a warning message but it display the proper results :

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/mywebsitehere/httpdocs/lib.classes/class.MySQL.php on line 132
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.