Judul : How to get the next auto-increment value
link : How to get the next auto-increment value
How to get the next auto-increment value
Do this simple things first create a table record :
For example:
create table batch
(id int primary key atuo_increment,
name varchar(200),
contact varchar(200)
);
(2)insert a first record into your record table then your initial id will be 1 after that remaining code will atuomatically increment the next value that will be 2..3...4...5...6
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("batch",$con);
$get=mysql_query("SELECT MAX(batchid) FROM batch");
$got = mysql_fetch_array($get);
$next_id = $got['MAX(batchid)'] + 1;
echo '<form action="" method=post>';
echo 'ID<input type=text name=id value="'.$next_id.'">';
echo 'NAME<input type=text name=name value="">';
echo 'CONTACT<input type=text name=contact value="">';
echo '<input type=submit name=submit value="submit">';
echo '</form>';
?>
Demikianlah Artikel How to get the next auto-increment value
Sekianlah artikel How to get the next auto-increment value kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.
Anda sekarang membaca artikel How to get the next auto-increment value dengan alamat link https://othereffect.blogspot.com/2016/02/how-to-get-next-auto-increment-value.html
0 Response to " How to get the next auto-increment value"
Post a Comment