Hi David,
I was recently importing a large feed and I get this error (after a long period)...it seems like it's importing most products, but I have a feeling it may be interupting part of the process.
During a web-based import, I get:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/mysite.com/includes/database.php on line 21
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/mysite.com/includes/database.php on line 26
Backfilling Reviews...
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/mysite.com/includes/database.php on line 21
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/mysite.com/includes/database.php on line 26
Done.
Back to admin homepage
----------------------------
During a shell-based import, I just get "Backfilling reviews...done".
Any ideas what the problem is? When I looked on the forum, I saw that perhaps other's dbs were corrupt, etc. It only happens when I use the drop filter. I deleted it and it imported fine.
Am I doing something wrong?
Thanks as always David! -Joe
Hi David,
Thanks for the debug version. It has indicated an interesting message. This is the end of the import process:
-------------------------------
[MySQL server has gone away]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/site.com/includes/database.php on line 26
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/site.com/includes/database.php on line 31
[UPDATE `feeds` SET imported='1237891745',products='' WHERE filename='10458.txt'][MySQL server has gone away]
Backfilling Reviews...
[UPDATE `products` SET rating='0',reviews='0'][MySQL server has gone away][SELECT product_name,AVG(rating) as rating,COUNT(id) as reviews FROM `reviews` WHERE approved <> '0' GROUP BY product_name][MySQL server has gone away]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/site.com/includes/database.php on line 26
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/site.com/includes/database.php on line 31
Done.
-------------------------------------------
It seems like the connection to the MySQL server is being disconnected? Does it look like that's the problem to you?
Thanks! -Joe
Hi Joe,
Yes - I have come across this very occasionally before. PHP is supposed to maintain the database connection; but in some installations / configurations it can time-out but PHP does not realise.
I've emailed you a version of database.php that will connect / close for each query and should solve the problem...
Cheers,
David.
Hi David,
Long time, no see! Hope you're doing well! I seem to have this problem again somehow? I don't believe I replaced the database.php file back with the old one. My server company says they upgraded the firewall so I'm not sure if that has anything to do with it. Actually, both of my databases are giving these errors and I know for sure I haven't changed one of them. Where should I start to check? Do you have any ideas?
Thanks a lot, -Joe
Quick update:
I can update/import fine if I use the "register" feed and go in through there to import. And I just tried "importing" again and now it is working. Most (or all) of my feeds are like this. Maybe they became corrupted or something? I have no idea but it seems to be working again now.
Thanks, -Joe
Hi Joe,
I've just emailed you the debug version of database.php that should indicate the problem...
Cheers,
David.