Php+mssql get last Insert ID value problem (online etc ~)
I remember MySQL has a mysql_insert_id () function to get the last inserted ID, such as $newid = mysql_insert_id (); What about the MSSQL database? Is there such a function? How do I output
many times we want to know when inserting data to MySQL The ID of the channel just inserted the data this is useful for us. Below I say three kinds of common methods and analyze their pros and cons one with the following statement: mysql_query ("
From:http://www.jb51.net/article/51473.htmThis article mainly introduces PHP to get the MySQL new record ID value of 3 methods, generally use PHP with function mysql_insert_id () can be implemented, the other 2 ways to use the right for special
Three kinds of return to MySQL tutorial insert a record to return the record ID method
Method One
ID Int (one) not null PRI key auto_increment,name varchar (a), backup varchar (50)Now, when you want to insert a record, return his ID value (insert
First, the use of statements:
Copy Code code as follows:
mysql_query ("SELECT Max (ID) from T1", $link);
Using this method, the maximum ID value is the last value, but when a multilink connection is used, the maximum ID is not
First, use the statement:
Copy CodeThe code is as follows: mysql_query ("SELECT Max (ID) from T1", $link);
Using this method gives the highest ID value, which is the last value, but when a multilink thread, this maximum ID is not necessarily the
mysql_query ("SELECT Max (ID) from T1", $link);
Copy CodeUsing this method gives the highest ID value, which is the last value, but when a multilink thread, this maximum ID is not necessarily the self-increment ID value of the inserted data,
The ID of the new record found today with mysql_insert_id () is incorrect,Although the source code is found to have a transaction write problem, but the most fundamental reason is that I inserted the data ID type is bigint typeThe method to get
Five vulnerable PHP database errors. Five vulnerable PHP database errors-including database pattern design, database access and database use business logic code-and their solutions. If there is only one way to use five vulnerable PHP database errors-
PHP Function Index 967 functions
A total of 967 functions
Abs: Get absolute value.
Acos: Gets the inverse cosine value.
Ada_afetch: Gets the return column of the database.
Ada_autocommit: Switch automatic change function.
Ada_close: Close Adabas D
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.