You are here:  » sort by Relevance generates error

Support Forum



sort by Relevance generates error

Submitted by teezone on Wed, 2008-06-04 06:37 in

Hi David, everything has been going really well, but a new problem just appeared..

Only when using the Search button - the link to "sort by Relevance" now generates the following error message:

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

For sure I've changed lots of things (work in progress!), but I'm not sure how to isolate this.. I already performed a database repair in case that was the problem.

Any help much appreciated, just not sure where to look!
Thanks
T.

Submitted by support on Wed, 2008-06-04 08:16

Hello Theresa,

It's almost certainly something to do with the ORDER BY clause in the SQL. I may have sent it to you before, but i'll email you the debug version of database.php. Upload this in place of /includes/database.php and it will print the SQL that caused the error and the MySQL error message which should indicate the problem...

Cheers,
David.

Submitted by teezone on Wed, 2008-06-04 20:43

Hi David, awesome thanks!

It seems I lost track of file versions across test environments - yes, I thought I had the debug database.php (my bad!).

Turns out there was stray "$orderBySelection = $orderByFullText;" line, which I changed to "$orderBySelection = $orderByDefault;" (I'm sure I put that in at some point while experimenting). It works perfectly now!

I'm going to try to resolve the price filters now, as I gave up for a while :)

T.