I am using MySQL, I need to insert a line in the first row, so I entered the row id Have to get. The code looks somewhat like the following:
column 1
primary key
And this is an auto-increment, how to get the value of
column 1
in the previous operation?
You can use Docs:
& lt ;? Php $ link = mysql_connect ('localhost', 'mysql_user', 'mysql_password'); If (! $ Link) {die (Could not connect: 'Mysql_error ()); } Mysql_select_db ('mydb'); Mysql_query ("Include mytable (product) values ('kossu')"); Printf ("The last inserted record has an ID% d \ n", mysql_insert_id ()); ? & Gt;
No comments:
Post a Comment