You are here:  » Help - broken site!

Support Forum



Help - broken site!

Submitted by thepricesite on Thu, 2007-06-28 15:37 in

Hi all,
My site has been working fine and all of a sudden everything has fell apart.

I'm getting the following errors :-

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/t/h/thepricesite_co_uk/includes/database.php on line 21

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/t/h/thepricesite_co_uk/includes/database.php on line 26

Its appearing all over the site but nothing has changed?

Any advice would be great as its causing huge down-time for me!

Mike

Submitted by support on Thu, 2007-06-28 15:56

Hi,

This implies that there is a database problem, which can mean any of three things. To find out, you can run setup.php, e.g.

http://www.yoursite.com/setup.php

If it fails at the first test (Checking database connection...) , this means your MySQL server is down or has crashed. You will need to contact your host regarding this..

If it fails at the second test (Checking database selection...), this means that your account no longer has access to the database, which could imply a configuration problem, perhaps if your host was doing maintenance. Again, contact your host to resolve this.

Finally, if it fails at the third test (Checking database tables...), then I'm afraid this most likely means that your Price Tapestry database itself has become corrupted. This can occasionally happen with any MySQL database, and might, for example, be down to a hard disk sector problem on your server. In this instance, the resolution is to drop your database and re-create it, which I'm afraid will mean that you will have to register and import all feeds from scratch. It is more likely to be a connection or authentication issue so hopefully this will not be necessary...

Cheers,
David.

Submitted by thepricesite on Thu, 2007-06-28 16:00

I get the following

Checking database connection...PASS

Checking database selection...PASS

Checking database tables...FAIL click here to install tables

When i press Click here - nothing happens?

Michael @ ThePriceSite

Submitted by support on Thu, 2007-06-28 16:05

Hi Michael,

I'm afraid that means that your Price Tapestry database has crashed. As I mentioned in the previous email this is most likely a result of a MySQL problem, but it could also be down to a disk full error. Have you checked that you are not exceeding your MySQL space limit as that could cause the server to fail to respond to queries on that database. If it's not a disk space issue, then i'm afraid you will probably need to delete the Price Tapestry database and recreate it with the same name.

However...

Do you have shell (Telnet or SSH) access to your server, and able to navigate to your MySQL database directory where you might be able to use the myisamchk command? It might be possible to repair the database if this is the case...

Either way, it would be worth contacting your host's support desk incase they have got a site-wide MySQL problem that they are aware of...

Cheers,
David.

Submitted by thepricesite on Thu, 2007-06-28 16:31

Hi David, thanks for the prompt response.
How do I recreate the database? Do I need to upload all the feeds again also?

Thanks

Michael @ ThePriceSite

Submitted by support on Thu, 2007-06-28 16:35

Hi Michael,

No need to upload the feeds again (assuming that they are still in your /feeds/ directory). What you will need to do is delete the database using whatever control panel / admin tool your server or webhost has given you to administer your database. Then, create a new database of the same name. Finally, run setup.php on your site again and click the link to install the tables. You can then re-register and import your feeds from the /admin/ pages.

Have you confirmed that it is not a disk space problem?

Cheers,
David.

Submitted by thepricesite on Thu, 2007-06-28 16:57

Hi David,
The support desk is now closed but it seems I have over 1.5GB free including MySql.
I don't have a control panel for the DB I was just given a Database name. I'm with UK2 if that helps?
Sorry the above is vague.

Michael @ ThePriceSite

Submitted by support on Thu, 2007-06-28 17:03

Hi Michael,

In that case, it does sound like "your" database has crashed, or at least one or more of the tables within it, and this i'm afraid can only be resolved by your hosting company. Hopefully, they will be able to restore it from backup, but they will be able to advise when you are able to contact them.

One thing you could try, although you may or may not consider it worthwhile, is to edit your config.php and enter or change the value for $config_databaseTablePrefix. For example:

$config_databaseTablePrefix = "test";

Then, run setup.php again and click the link to install the database tables. If this works, then it means that the tables in your original database have become corrupted (for any of the reasons given above) - you would still need your host to purge or repair these for you. If this doesn't work, it means that your database has really crashed and will require your host to resolve the problem. The bright side (if this is the case) is that it probably means your tables are OK and they will be able to get your database back online.

Cheers,
David.

Submitted by thepricesite on Thu, 2007-06-28 17:14

Hi David - ill try it as soon as I get back to my laptop.
Ill also get on the phone to UK2 again first thing tomorrow.

Again many thanks for your help.

Michael @ ThePriceSite

Submitted by thepricesite on Fri, 2007-06-29 09:46

I took your advice with regards to running config.php after making the mod to setup.php - and it all works again.

Uk2 didn't get back to me so i'm just glad its all up and running again! :)

Finally on a completely seperate note, i do remember you posting a note on here about a revised search.php page which performed better. I did use it but since placed the old version back by mistake, could you advise where i can find the info on the latest search.php ?

Michael @ ThePriceSite

Submitted by support on Fri, 2007-06-29 09:50

Hi Michael,

The search.php from the distribution has been stable for several months now, so I would simply download the distribution again and extract search.php from it...

Cheers,
David.

Submitted by thepricesite on Fri, 2007-06-29 16:03

Ok will do - i may have a 'dodgy' character in the file somewhere.

Thanks for your help, have a good weekend

Michael @ ThePriceSite