You are here:  » error in the status bar

Support Forum



error in the status bar

Submitted by rolli1 on Thu, 2007-03-08 15:44 in

Hi David,
I was out for 2 days. When back, I checked my site and found an error sign in the status bar of IE. The error details are:

row 212
error: "document.search.q" is 0 or no object
code:0

What could this mean and how can I eleminate that error?

Regards

Roland

Submitted by support on Thu, 2007-03-08 15:49

Hi Roland,

If $config_useJavaScript is set to true, the script uses JavaScript to set focus on the main search box on the index page.

If you have edited your main page and no longer have the search form, or you have edited your search form and the main edit box no longer has the id='q' parameter then you will get this error...

If you're not sure, email me a copy of your index.php and html/searchform.php and i'll take a look for you...

Cheers,
David.

Submitted by rolli1 on Thu, 2007-03-08 23:45

Hi David,

it was not in the searchform.php nor in the index.php. I use the following code in my header.php:

<?php
require("html/searchform.php");
?>

for having a second search possibility on the page. If I eleminate this I get no error message. How could I manage to have a second search form without getting this error?

Regards

Roland

Submitted by support on Fri, 2007-03-09 08:46

Hi Roland,

If you have the search form displayed twice that will explain the error because the JavaScript does not know which search form to set focus to. The easiest thing to do is simply disable this feature in config.php as follows.

  $config_useJavaScript = false;

That will clear the error.

Cheers,
David.

Submitted by rolli1 on Fri, 2007-03-09 21:57

Thanks, that works.

Regards
Roland

Submitted by blogmaster2003 on Tue, 2010-05-04 20:22

Hi

im having this problem too, im using a pricetapetrytemplates.com theme, so what should i change to not display this error in ie?

im also seeing:

Warning: Cannot modify header information - headers already sent by (output started at /home/apparelc/public_html/includes/database.php:27) in /home/apparelc/public_html/html/header.php on line 12

after putting a product in the box of search

i think the theme im using isnt suitable for the latest version?

PS: Im also looking for someone that can do a web2.0 design for the latest version of pt.

Submitted by support on Wed, 2010-05-05 06:31

Hi,

The warning message is being generated because the HTTP headers (the code for which is in html/header.php) cannot be sent by PHP because something has already generated some output. PHP generates output by default at the end of every non-PHP code line, and in this case, it is saying that has happened in your includes/database.php file.

Open that file in your text editor, and make sure that there is absolutely nothing outside of the <?php ?> tags - it is indicating line 27, so that looks like there is a new-line at the end of the file, so removing that should solve the problem...

Cheers,
David.

Submitted by blogmaster2003 on Wed, 2010-05-05 12:19

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/apparelc/public_html/includes/database.php on line 27

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/apparelc/public_html/includes/database.php on line 32

i already checked in that file and didnt saw nothing wrong.

Im getting these errors but not all time in the home page.

if i open the home page it sometimes open ok and sometimes with that error.

I presume its a problem with the featured products.

I have changed that code you also wrote in one thread about random featured products, so im presuming the problem is with that code?

Its weird because if i hit f5 for 10 times, i will get that error message 3 or 4 times.

Could you see it for me?

apparelcombined.com is the url.

Submitted by support on Wed, 2010-05-05 12:40

Hi,

If you enable Database Debug mode, the reason for the database errors will be displayed - if you could turn that on in config.advanced.php, by changing line 6 as follows:

  $config_databaseDebugMode = TRUE;

Then if you could browse to one of the pages causing the error, and let me know the SQL and MySQL error message that is displayed that will tell me what area of the script is causing the problem...

Cheers,
David.

Submitted by blogmaster2003 on Wed, 2010-05-05 19:44

Hi

this is the error message i got on home page when debug is true:

[SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `products` WHERE name IN ('Sunflowers Jacquard Napkins','O'Neill Dresses/Skirts : O'Neill Ojai White Juniors Dress','Red by Burton Avid Helmet') GROUP BY name][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 'Neill Dresses/Skirts : O'Neill Ojai White Juniors Dress','Red by Burton Avid Hel' at line 1]
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/apparelc/public_html/includes/database.php on line 27

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/apparelc/public_html/includes/database.php on line 32

Submitted by support on Thu, 2010-05-06 08:09

Hi,

That error message would indicate that a modification made the SQL in index.php is not using a call to database_safe() - as the apostrophe in one of the product names is breaking the SQL.

If you could email me your index.php i'll check it out for you...

Cheers,
David.