You are here:  » Unexpected error

Support Forum



Unexpected error

Submitted by sbedigital on Tue, 2012-05-01 20:05 in

Hi Dave,

I don;t hoe and why, I am gettng this error.

[01-May-2012 18:09:59 UTC] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/*****/public_html/includes/database.php on line 27
[01-May-2012 18:09:59 UTC] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/*****/public_html/includes/database.php on line 32
[01-May-2012 18:09:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/*****/public_html/includes/database.php:27) in /home/******/public_html/html/header.php on line 5

After the log hunting (as my only way of debugging) I have maged to figure out, if you type /merchant/xyz/random_anything_page.html
I get that error instead of PT showing "Not found Message".

This also happens for /brand/ and /category/

Please note: on root level each item for example /category/ , /brand/ or /merchant/ if you type in randon pages or anything, PT works fine. Another word if type /merchant/a_random_word or /merchant/a_random_word.html PT works fine, but when I go one level deeper I start to get the error.

I am using you experimental version of search.php for partial index search method.

Any idea please???

Noor

Submitted by support on Wed, 2012-05-02 07:20

Hello Noor,

In your search.php look for the following code at line 8:

  $page = (isset($_GET["page"])?intval($_GET["page"]):1);

...and REPLACE with:

  $page = (isset($_GET["page"])?intval($_GET["page"]):1);
  if (!$page) $page = PHP_INT_MAX;

That will channel the code into your existing 404 handling for excess page number values..

Cheers,
David.
--
PriceTapestry.com

Submitted by sbedigital on Wed, 2012-05-02 17:09

Sorry Dave, problem is not fixed.

I am getting following SQL Error

[SELECT SQL_CALC_FOUND_ROWS id,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `products` IGNORE INDEX (merchant,category,brand) WHERE brand = 'Hi Grade' GROUP BY search_name LIMIT 9.22337203685E+19,10][You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '9.22337203685E+19,10' at line 1]

Here is an example where the error being generated:

{link saved}

Here is the current contents of the my version of search.php script:

{code saved}

Can this be modifed to serve PT's /html/noresults.php page for non-existent items by making script to check it it exist in the database. If NOT serve the /html/noresults.php page

Thanks

Noor

Submitted by support on Thu, 2012-05-03 09:02

Hello Noor,

I'll follow up by email...

Cheers,
David.
--
PriceTapestry.com