postgresql - Silex last insert id -


i not found short way latest insert id in silex

 $app['db']->insert('users', array(                         'password' => password_hash($data['password'], password_bcrypt),                         'email' => $data['email'],                         'name' => $data['name'],                         'surname' => $data['surname'],                         'activation_code' => $activation_code,                      )                 ); 

does me how latest insert id

yes found solution, since using pgsql must have declare sequence.

$userid = $app['db']->lastinsertid('users_seq'); 

this code worked perfectly...


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -