I like development best. Writing a program can improve your strength and add some code to your favorites! It is really good. For some reason, you need to obtain the maximum id of the database. So this section of php obtains the largest id code of the database. Here, max (id). Here, the id is used to obtain the largest id. For other fields, enter other fields.
Method 1
$ Fh = mysql_query ("select MAX (id) from log ");
$ C_echo = mysql_fetch_array ($ fh );
Echo $ c_echo;
Method 2
<? Php
// Execute the statement for inserting the database
//......
$ GetID = mysql_insert_id (); // $ getID is the ID of the last record
?>
The PHP function mysql_insert_id () returns the value of the field defined by AUTO_INCREMENT after the last INSERT query is executed.
Method 3
Msyql_query ("select last_insert_id ()");
Last_insert_id () is a mysql function that also takes effect on the current link.
This method solves the bigint type problem in mysql_insert_id ().