Wednesday, November 22, 2017

How to get the next auto-increment id in mysql

Do you want the next id, or the id of the row that you are currently inserting? That is, should the id at the end of the payment code be the id of the row in which the payment code is stored?

The way how to you get the last value of auto increament:
$SQL = "SELECT AUTO_INCREMENT sequentialnumber FROM information_schema.tables WHERE table_name = 'imagegambar'";
$QUERY         = mysqli_query($KONN,$SQL);
$rows              = mysqli_fetch_array($QUERY);
$tempnumber  = $rows["sequentialnumber"];

return $tempnumber;

Source:
https://stackoverflow.com/questions/6761403/how-to-get-the-next-auto-increment-id-in-mysql

Cara Instal Kdevelop

Pembaca budiman yang terbiasa menggunakan Kdevelop sebagai text editor untuk membuat atau membaca semua script yang dibuat. Berikut ini cara...