Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
行の 2 番目の要素 (chatID) が自動インクリメントされた主キー (messageID) の値をコピーするテーブルに行を挿入する必要があります。
safe_query("INSERT INTO ".PREFIX."messenger ('messageID', 'chatID') VALUES('','')");
どんなアイデアでも非常に役に立ちます。ありがとう。
PHPでレコードを挿入するlastInsertId();と、chatID を取得して更新します
lastInsertId();
$inserted_id = $pdo->lastInsertId(); $sth2 = $pdo->prepare("UPDATE ".PREFIX."messenger SET `chatID`= $inserted_id WHERE `messageID`=$inserted_id"); $sth2->execute();