static properties can contain resources? [resolved. at last]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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..
Post Reply