Log in

View Full Version : Error Mysql


noel
10-26-2005, 05:22 PM
Hello,
I have this error when I try the spider in shell command :

<b>Warning</b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in <b>/home/httpd/vhosts/mysitename.com/httpdocs/google/admin/robot_functions.php</b> on line <b>1357</b><br />

What I 'm wrong ;)

Thank You

Noël

Charter
10-26-2005, 11:40 PM
Assuming you are using PhpDig 1.8.8 RC1, the relevant code is the following, but nothing in this code itself seems to indicate the problem.

$key = addslashes($key);
//if keyword exists, retrieve id, else insert it
$requete = "SELECT key_id FROM ".PHPDIG_DB_PREFIX."keywords WHERE keyword = '".$key."'";
$result_insert = mysql_query($requete,$id_connect);
$num = mysql_num_rows($result_insert);

Try changing:

$result_insert = mysql_query($requete,$id_connect);

To the following:

$result_insert = mysql_query($requete,$id_connect) or die(mysql_error());

And see what prints onscreen.

If you upgraded from PhpDig 1.8.7 to PhpDig 1.8.8 RC1, there is an UPGRADE.txt instruction file that comes with the PhpDig 1.8.8 RC1 package.

noel
10-30-2005, 04:56 PM
Ok work fine, but in order I haven't the error (die) do you think the informations are put in the database , whiout problems ?

Charter
11-01-2005, 03:41 PM
If the MySQL query dies, then whatever happened before death went into the tables. Once death occurs, nothing happens. The die(mysql_error()) in the second post is working on a SELECT query, so it's doubtful that you'd encounter problems.