You are here:  » Error on website and whentrying to import

Support Forum



Error on website and whentrying to import

Submitted by AD_Mega on Fri, 2007-09-21 02:16 in

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

Submitted by support on Fri, 2007-09-21 10:44

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.

Submitted by AD_Mega on Sun, 2007-09-23 07:44

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.

Submitted by support on Sun, 2007-09-23 07:46

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.

Submitted by AD_Mega on Sun, 2007-09-23 07:57

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

Submitted by support on Sun, 2007-09-23 08:03

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.

Submitted by AD_Mega on Sun, 2007-09-23 08:36

It works but taked awhile to load.

Submitted by support on Sun, 2007-09-23 08:38

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.