If you use php
to connect to mysql
you can use mysql_insert_id()
to point to last inserted id.
Like this :
mysql_query("INSERT INTO mytable (1, 2, 3, 'blah')");
$last_id = mysql_insert_id();
See this : mysql_insert_id()
More Related Contents:
- Using PHP data in MySQL [closed]
- Gather column name of a table from database [closed]
- I am seeing this error on submitting form Error: query was empty [closed]
- How to convert the json image url string into Bitmap image to display images in android application
- save user images in MYSQL database by which method? [closed]
- How to use multiple databases in Laravel
- PDO get the last ID inserted
- Automated or regular backup of mysql data
- strange character encoding of stored data , old script is showing them fine new one doesn’t
- Show values from a MySQL database table inside a HTML table on a webpage [duplicate]
- Warning: mysqli_connect(): (HY000/1045): Access denied for user ‘username’@’localhost’ (using password: YES)
- How can I store and retrieve images from a MySQL database using PHP?
- PDO mysql: How to know if insert was successful
- Importing CSV data using PHP/MySQL
- How to loop through a mysql result set
- How to store file name in database, with other info while uploading image to server using PHP?
- How to successfully rewrite old mysql-php code with deprecated mysql_* functions?
- Mechanisms for tracking DB schema changes [closed]
- Fetching single row, single column with PDO
- Is there any way to check the performance of mysql Indexing
- IP address storing in MySQL database using PHP [duplicate]
- How to store an array into mysql?
- Get all child, grandchild etc nodes under parent using php with mysql query results
- Saving images in database mysql
- PHP – Secure member-only pages with a login system
- Using LIKE in bindParam for a MySQL PDO Query [duplicate]
- Selecting all fields except only one field in mysql [duplicate]
- mysqli – fetch_Array error call to a member function fetch_array() on a non-object mysqli [duplicate]
- MySQL ORDER BY rand(), name ASC
- Auto Increment skipping numbers?