[symfony-users] Re: getting id of last INSERT

2007-06-23 Thread Martin Kreidenweis
Hi. > I want to get the ID (auto increment) of my last INSERT using > something similar to > the php function mysql_insert_id() > > $lastInsertedID = mysql_insert_id(); > > Can this be done using the standard Symfony data abstraction classes > Propel & Criteria? If so how do you do it? Sure: $

[symfony-users] Re: getting id of last INSERT

2007-06-22 Thread Birchandra Singh
Hello, It may be what you want: $dbAdap = new DBMySQL(); $con = Propel::getConnection(PhonePeer::DATABASE_NAME); $dbAdap->lockTable($con, "table1"); $t1 = new Table1(); $t1->setNumber($number); $t1->save(); $last_id = $t1->getPrimaryKey(); $dbAdap->unlockTable ($con, "table"); echo $las

[symfony-users] Re: getting id of last INSERT

2007-06-22 Thread Adriaan van N.
$item = new Item; $item->setName('foo'); $item->setContent('bar'); $item->save(); $item->getId(); On Jun 22, 9:20 pm, slinky66 <[EMAIL PROTECTED]> wrote: > Hello, > > I want to get the ID (auto increment) of my last INSERT using > something similar to > the php function mysql_insert_id() > > $l