You are here:  » supplied argument is not a valid MySQL result resource

Support Forum



supplied argument is not a valid MySQL result resource

Submitted by redspan on Tue, 2008-03-25 14:59 in

Hello,

I seem to have broken something when copying files from a running site to a new site.

The link to Merchants works fine, but when I try Categories, or Brands I see this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/mydomain.com/httpdocs/includes/database.php on line 21
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/mydomain.com/httpdocs/includes/database.php on line 26
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mydomain.com/httpdocs/includes/database.php:21) in /var/www/vhosts/mydomain.com/httpdocs/html/header.php on line 12

I'm sure it's something quite simple like using an old file.

Anyone got any ideas?

Thanks,
Ben

Submitted by support on Tue, 2008-03-25 15:05

Hi Ben,

I'll email you the debug version of database.php - when you receive it, upload it to your /includes/ directory and make the error occur again. It will then show what SQL caused the database error, which should point to the problem...

Cheers,
David.

Submitted by redspan on Tue, 2008-03-25 17:24

Hi David,

Got it, thanks. Here's the error it shows:

[SELECT category FROM `category_cache`][Table 'MHHB1.category_cache' doesn't exist]

Regards,
Ben

Submitted by support on Tue, 2008-03-25 17:29

Hi Ben,

So it looks like you've made a modification to the site that you have copied the files from, but on your new site you currently have the default database, so you will need to make the same changes to the database as required by the mods that your code uses. It looks like the category and brand cache mod from this thread...

http://www.pricetapestry.com/node/1416

If the files are already copied across, you should just be able to run scripts/buildcachetables.php on your new site and it will update the database...

Cheers,
David.

Submitted by redspan on Tue, 2008-03-25 17:44

Hi David,

Perfect, fixed!

Thanks :)

Ben