Page 2 of 2

Posted: Tue Aug 01, 2006 5:53 am
by volka
eh.... let me rephrase that. what do the error_logs indicate?
http://de2.php.net/error_log wrote:Sends an error message to the web server's error log, a TCP port or to a file.
for apache that's the file error.log.
e.g. what does it tell you about the database connection?

Posted: Tue Aug 01, 2006 6:02 am
by Jenk
Nothing, the only errors in the error log are the same as the php warnings displayed.

It's like I said before, the functionality works, it reads/writes session data fine, but I get warnings displayed.

If I remove self::$link from any/all of the mysql_* functions, it won't work (and receive different errors because of this)

The reason the errors are flagging, it would appear, is because the resource type is lost between method calls, as per my example previously. However the actual pointer/handler must be fine because I can still use it.

Posted: Tue Aug 01, 2006 6:08 am
by volka
Jenk wrote:The reason the errors are flagging, it would appear, is because the resource type is lost between method calls, as per my example previously. However the actual pointer/handler must be fine because I can still use it.
mysql_query tries to establish the default connection if the one given as parameter is invalid.

So, which one is printed from error_log('jmt_Session::open '.(($retval)?'success':mysql_error()));?

btw: I used php 5.1.4 on win32 and gentoo linux to test the script.

Posted: Tue Aug 01, 2006 10:03 am
by Jenk
I've already said it fails if I remove self::$link, and generates a different error, that different error being "unable to connect using 'ODBC'@'localhost' (using password: no)" and it is connecting and the session data is updating when I have self::$link in.

am using 5.1.4 also in win32, but not got a linux box to try on.

Will run error_log() as in your post when I get home.

Thanks for your assistance.

Posted: Tue Aug 01, 2006 4:59 pm
by Jenk
At last!

I swapped to a persistant connection and it works without error.

Can't imagine the connection is closing/expiring that quickly? What else would cause it to close? [edit: just occured to me that perhaps it's the change in scope that is closing the connection?]

Jeez.. I'm actually quite worked up now, it's taken me the best part of 3 days to get such a 'simple' thing working..