PDA

View Full Version : SQL related error - help greatly appreciated!


digger
09-10-2006, 02:59 AM
Firstly, I have been at this for about four days solid. I did a website for a client in Zencart, which has a SQL database setup on Bluehost aswell as the space for the site. All has been going well for a few months, then there was a slight blip with the password he forgot, which was sorted by myself. Everything looked ok. What happens, not sure if it as a result of that, but the first page looks ok, but any subsequent click brings this up:-

Warning: Variable passed to each() is not an array or object in
/home/thegemtr/public_html/essencegifts/includes/classes/db/mysql/query_factory.php
on line 114

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at
/home/thegemtr/public_html/essencegifts/includes/classes/db/mysql/query_factory.php:114)
in /home/thegemtr/public_html/essencegifts/includes/functions/sessions.php
on line 102

Warning: Cannot modify header information - headers already sent by (output
started at
/home/thegemtr/public_html/essencegifts/includes/classes/db/mysql/query_factory.php:114)
in
/home/thegemtr/public_html/essencegifts/includes/init_includes/init_templates.php
on line 78


I do a system restore to a month earlier, and the problem disappears. Back to the most recent site status, but reinstalling zencart, and the problem remains. So I have narrowed it down to the SQL file itself. I have used WINMERGE to compare the file, to no avail. I try to use the Bluehost PHPmyAdmin to do an import or large SQL query to restore all the newest information on to an old restore, but the I get a page cannot be found.

I would be so grateful for any help, this one has got me stumped big time, not to mention raised blood pressure! I believe I have looked at all avenues within my experience, and now I have nowhere to turn.

Many thanks in advance,

James

fitz
09-10-2006, 07:12 AM
im no expert...

but if you have any HTML before the session tags that could be the problem...

but without looking at the code i am not that good to give you the exact problem.

fitz

digger
09-11-2006, 05:00 AM
Hello Fitz,

Many thanks for replying to this thread. I was kind of hoping that this would be the problem, but after narrowing it down to the SQL file, it looks like something is causing me a headache there. I compared to a working backup SQL, and I fail to see what has happened. I can only assume at this point that somehow (?) the latest SQL has got corrupted.

Kind thanks,

James

Maggilove
09-11-2006, 02:36 PM
Have you checked that there is no whitespace before the opening or after the closing php tags in each of the files referred to in the error messages?

digger
09-16-2006, 01:17 PM
Hello there,

I have checked for white spaces, and there are none at present. Comparing it to the old SQL file, it looks the same layout. Very bizarre, I am clueless at the moment.

James

vegasgwm
09-17-2006, 08:08 AM
Variable passed to each() is not an array or object in
/home/thegemtr/public_html/essencegifts/includes/classes/db/mysql/query_factory.php
on line 114

It seems that everyone else focused on the "headers allready send" error, which is not the problem here. (it just there because there was output before the error on line 114.) That's where your problem lays. Look closer in to those lines where your array is being created. post the factory.php section around line 114. (to me this does not look like a sql problem, but a php problem)

adam-s
09-17-2006, 03:41 PM
vegasgwm is right. The warning is output that fouls up the session_start().

When you finish work on the site then you can set display_errors off in php.ini or you can set things up to not display warnings if you want.

This will hide the warning about the array.