My sit stopped working for some reason. I get this error when I try to import at the command line.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/megashop/public_html/includes/database.php on line 9
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/megashop/public_html/includes/database.php on line 13
Yes there was something wrong with the database. somehow it corrected itself. It working fine except the brands page doesn't show.I get a 500 error.
A 500 server error will have been generated by Apache, so if you have error logging enabled have a look in the error log and it should give a reason for the 500...
Cheers,
David.
This is the error I'm getting.
FATAL: emalloc(): Unable to allocate 64 bytes
[Sun Sep 23 01:29:36 2007] [error] [client 198.118.127.182] Premature end of script headers: /home/megashop/public_html/brands.php
Hi,
This indicates that the brands list is too large to be handled by the amount of memory available to PHP. If this site is on your VPS, you should be able to increase the memory available to PHP by editing php.ini, and changing the memory_limit value as follows:
memory_limit = 128M
You will need to restart Apache / PHP after making this change for it to take effect...
Cheers,
David.
Hi,
As it's having to run such a large query (the reason for the memory error) that would explain the slow loading time. Bear with me and i'll look at improving the performance of this query for you - it might involve a new database table to hold the brand list (updated after each import)...
Cheers,
David.
Hi,
Can you confirm that the site itself is running normally, so it is not a case of the database being unavailable? One thing you can do to diagnose a database problem is to run the setup script...
http://www.yoursite.com/setup.php
...as this will tell you if there is any problem with the database connection or selection.
Cheers,
David.