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
Post a Comment