PDA

View Full Version : Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource


ullone
11-23-2003, 07:17 AM
I have installed your search engine. I have had a problem to install it because i'm not an expert in plesk and i have not the capability to create an user batabase before the creation of the database itself. Then ... i' have created the database ( given to it the user) and then i have read SQL . After the installation of the script with the option "update" the database (and not "create"). All is well but after 2 good test ( lorenzone.it and clarence.com), a test is not good. I have an error. When i index repubblica.it (the first italian newspaper) i have this error :

( Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478



-----------------



SITE : http://www.repubblica.it/
Exclude paths :
- java
- javascript
- swf
- online3
- news
- quotidiano
1:http://www.repubblica.it/
(time : 00:01:06)
+ + +
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
level 1...
2:http://www.repubblica.it/misc/gerenza/gerenza.html
(time : 00:01:41)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478

3:http://www.repubblica.it/servizi/trova.html
(time : 00:01:45)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+
4:http://www.repubblica.it/servizi/scrivi.html
(time : 00:01:50)

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478

5:http://www.repubblica.it/indici/politica/politica.htm
(time : 00:01:56)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + + +
6:http://www.repubblica.it/indici/cronaca/cronaca.htm
(time : 00:02:04)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + +
7:http://www.repubblica.it/indici/economia/economia.htm
(time : 00:02:11)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + +
8:http://www.repubblica.it/indici/esteri/esteri.htm
(time : 00:02:20)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + +
9:http://www.repubblica.it/indici/sport/sport.htm
(time : 00:02:28)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + + + + + + + + + + +
10:http://www.repubblica.it/indici/scienza_e_tecnologia/scienza_e_tecnologia.htm
(time : 00:02:40)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + +
11:http://www.repubblica.it/indici/spettacoli_e_cultura/spettacoli_e_cultura.htm
(time : 00:02:48)
+
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 462

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/eulisse.com/httpdocs/phpdig/admin/spider.php on line 478
+ + + + + + + + +

Charter
11-23-2003, 07:35 AM
Hi. Did you set a table prefix in the connect.php file? If you used init_db.sql to make the tables directly, the table names do not contain the prefix.

ullone
11-23-2003, 09:23 AM
Prefix ??? Not. Not. I only read the SQL. I had not touch connect file. What Prefix ?
But... Installation update procedure do not write the "prefix" in the configuration files ? Now i read file connect. ...
And i try to understand. ...

Charter
11-23-2003, 09:31 AM
Hi. Did you run install.php? It will write if the permissions are set. A prefix is not needed. Does the information in the connect.php file match your database?

ullone
11-23-2003, 09:35 AM
// Connection configuration
define('PHPDIG_DB_PREFIX','');
define('PHPDIG_DB_HOST','localhost');
define('PHPDIG_DB_USER','username');
define('PHPDIG_DB_PASS','password');
define('PHPDIG_DB_NAME','database');

Structure of DataBase in PhpMyAdmin :

Home
dig (7)
engine
excludes
keywords
logs
sites
spider
tempspider

I do not understand. Prefix is blank ? Or "dig" ?

Charter
11-23-2003, 09:44 AM
Hi. The define('PHPDIG_DB_PREFIX',''); so prefix is blank.

If there were a prefix, say prefix_ for example, the tables would look like:

prefix_engine
prefix_excludes
prefix_keywords
prefix_logs
prefix_sites
prefix_spider
prefix_tempspider

You do not need a prefix. Hmm.. why does "Warning: mysql_num_rows()" show?

What version of PHP do you have?

ullone
11-23-2003, 09:49 AM
The strange is that i have this error only with indexing of repubblica.it (the first italian site). Not with the 2 other site i have indexed ( lorenzone.it and clarence.com ). For the site repubblica.it i have this error but the procedure continue and now is finished. A strange error.

Charter
11-23-2003, 09:53 AM
Hi. There is no prefix. This is okay. What version of PHP?

ullone
11-23-2003, 10:01 AM
The latest. I suppose (4.3). I have Plesk 6.0.2. with RedHat 9.0. And i have the same error also in Localhost (with the latest, i have install in localhost this server) http://www.appservnetwork.com/ .

ullone
11-23-2003, 10:08 AM
If i enter another time in admin (i have not changed the password for the moment admin admin) here :

http://www.eulisse.com/phpdig/admin/spider.php

For the site repubblica.it the error is not showed.
I do not understand if this a bug of the update procedure in relation of this site or if this an error that i can correct.

CHMOD all 777

Spidering in progress...
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*

--------------------------------------------------------------------------------
SITE : http://www.lorenzone.it/
Exclude paths :
- admin_generale/
- Xgif_linkate/
- forum/
No link in temporary table

--------------------------------------------------------------------------------

links found : 0
...Was recently indexed
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*
*http://www.clarence.com/ Locked*
*http://www.repubblica.it/ Locked*

Charter
11-23-2003, 10:15 AM
Hi. In <? phpinfo(); ?> what is the error_reporting number?

Charter
11-23-2003, 10:17 AM
To remove a lock, in the admin panel, click the site, click the update button, and click the unlock link. In config.php, you can set LIMIT_DAYS to zero.

ullone
11-23-2003, 10:18 AM
Repubblica.it give me no error if i try to search in the box here :
http://www.eulisse.com/phpdig/index.php
Mah. ... Boh. ...

http://www.eulisse.com/phpdig/index.php?template_demo=.%2Ftemplates%2Fphpdig.html&site=0&path=&result_page=index.php&query_string=repubblica&search=Go...&limite=10&option=start

ullone
11-23-2003, 10:28 AM
I' m only a newbie. I'm absolutely not an expert. I made law in university. ... I'm a beginner in server dedicated. I have a server only by 2 weeks. ...

Pardon my stupidity but. ...
What is : <? phpinfo(); ?> ???

Charter
11-23-2003, 10:49 AM
Hi. That is a very small script to check your PHP configurataion.

I don't think this is a problem with your configuration though. I am able to duplicate these "Warning: mysql_num_rows()" with the repubblica.it site.

ullone found a bug. ;)

ullone
11-23-2003, 10:57 AM
Pardon my stupidity. I'm a newbie.

Database dig - Tabella tempspider in esecuzione su localhost

file text
id mediumint(11) auto_increment
level tinyint(6)
path text
site_id mediumint(9)
indexed tinyint(1)
upddate timestamp(14)
error tinyint(1)

For spider.php i have downloaded the latest version in your site. It is the same of download. I have not changed nothing in spider.php.

If you try in localhost to install in this mode (in Plesk without a separate installation of phpmyadmin i need to read sql and then to make the update) i think that you have the same error with repubblica.it.
I have only created the database and read the sql. Then i have installed with install.php and used update option in admin install.php . For the moment i have this error only with this url. Now i try other address.

Other error are not present.

http://www.eulisse.com/phpdig/index.php

Charter
11-23-2003, 11:17 AM
If you go to the HTML source at repubblica.it, you will see things like the following:

sthome.html\ (note the \ after html)

It is the \ that is causing the problem because it is escaping a ' needed in the query string. Fix forthcoming...

ullone
11-23-2003, 11:29 AM
I think that a part the error the index procedure is o.k.. In search engine of my site if a write "repubblica" i have many result. I think that the spider do not forget nothing. It is also an anti estetic error. Pardon my english. I'm italian.
However. I like this search engine.

Charter
11-23-2003, 11:29 AM
Hi. Here's a fix.

In spider.php find:

$query = "SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."tempspider WHERE path like '".str_replace("'",'',$lien['path'])."' AND file like '".str_replace("'",'',$lien['file'])."' AND site_id='$site_id'";

and right before it add:

if (!get_magic_quotes_runtime()) {
$lien['path'] = addslashes($lien['path']);
$lien['file'] = addslashes($lien['file']);
}

Again, in spider.php find:

$query = "SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."tempspider WHERE path like '".str_replace("'",'',$lien['path'])."' AND file like '".str_replace("'",'',$lien['file'])."' AND site_id='$site_id'";

and replace with:

$query = "SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."tempspider WHERE path like '".$lien['path']."' AND file like '".$lien['file']."' AND site_id='$site_id'";

Also, in spider.php find:

$query = "SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."spider WHERE path like '".str_replace("'",'',$lien['path'])."' AND file like '".str_replace("'",'',$lien['file'])."' AND site_id='$site_id' $andmore";

and replace with:

$query = "SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."spider WHERE path like '".$lien['path']."' AND file like '".$lien['file']."' AND site_id='$site_id' $andmore";

Remember to remove any "word" wrapping in the above code.

motopsycho
05-18-2004, 01:39 PM
Hello,
I just received a similar error but I am using verion 1.8 and it already has these fixes in place.

Thanks