我似乎找不到这个。也许我问错了问题。我的数据库中的第一个字段是 INT 设置为自动递增的 id。当我创建一个新条目时,我想获取创建的 id,但我不知道如何。
$query = mysqli_query($myConnection, "INSERT INTO books (title, author, description)
VALUES('$title','$author','$description')")
or die (mysqli_error($myConnection));
echo 'Operation Completed Successfully! <br /><br /><a href="index.php">Click Here</a><br /><br />';
//HERE I WOULD ALSO LIKE TO ECHO THE ID THAT WAS CREATE WITH AUTO INCREMENT
echo $title . "<br />" . $author . "<br /> . $description;