|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-05-19 22:40 UTC] m at saffitz dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
Description: ------------ I have a very standard session handler I'm writing, with the write function as below. I'm using propel (propel.phpdb.org) as an object persistence layer. When the function is called automatically by the session system, the first print statement correctly prints the session id. However, an exception is thrown when the record does not yet exist in the database, and the catch block in entered. Here, the second print statement incorrectly prints $id, printing instead some path: Output: 0a900f631d4ebf175f7b85ec262ca7292 /Users/msaffitz/cvswork/aspen-in Failed to select one and only one row. /Users/msaffitz/cvswork/aspen-in Reproduce code: --------------- public function write( $id, $val ) { print "$id<br>\n"; try { $session = SessionsPeer::retrieveByPk($id); } catch ( PropelException $exception ) { print "$id<br>\n"; print $exception->getMessage(); $session = new Sessions(); $session->setId($id); } print $id; $session->setDatavalue($val); $session->setModificationDate('NOW()'); $session->save(); } Expected result: ---------------- The variable $id's value should persist.