PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Troubleshooting (http://www.phpdig.net/forum/forumdisplay.php?f=22)
-   -   Error Mysql (http://www.phpdig.net/forum/showthread.php?t=2209)

noel 10-26-2005 05:22 PM

Error Mysql
 
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.
Code:

          $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:
Code:

          $result_insert = mysql_query($requete,$id_connect);
To the following:
Code:

          $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.


All times are GMT -8. The time now is 03:09 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.