note 125187 added to pdo.lastinsertid

From: Date: Mon, 13 Jul 2020 13:39:03 +0000
Subject: note 125187 added to pdo.lastinsertid
Groups: php.notes 
Request: Send a blank email to php-notes+get-214864@lists.php.net to get a copy of this message
what is the correct way to get autogenerated id using PHP? tried this, but no result: "INSERT INTO "tasks" ("user_id", "desc") VALUES (:MeDoO_2_mEdOo, :MeDoO_3_mEdOo); SELECT LAST_INSERT_ID();" PDO->last insert id is wrong; fetchAll() returns: array(0) {} ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 178.218.31.151) ---- Manual Page -- http://php.net/manual/en/pdo.lastinsertid.php Edit -- https://master.php.net/note/edit/125187 Del: integrated -- https://master.php.net/note/delete/125187/integrated Del: useless -- https://master.php.net/note/delete/125187/useless Del: bad code -- https://master.php.net/note/delete/125187/bad+code Del: spam -- https://master.php.net/note/delete/125187/spam Del: non-english -- https://master.php.net/note/delete/125187/non-english Del: in docs -- https://master.php.net/note/delete/125187/in+docs Del: other reasons-- https://master.php.net/note/delete/125187 Reject -- https://master.php.net/note/reject/125187 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214864) next »