PDO Last Insert ID always the right one?

前端 未结 3 1249
忘掉有多难
忘掉有多难 2020-12-03 17:21

I have the following code:

prepare(\"INSERT INTO a_table (id, a_field) VALUES (\'\', (:a_field)\");
$query->bindParam(\":a_field\",          


        
3条回答
  •  悲&欢浪女
    2020-12-03 17:36

    PDO will return you the last ID inserted by the current active database connection.

提交回复
热议问题