Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on How do I find the ID of a new row added to a table? within the PHP forums, part of the Web Development category; Hello all, How do I find the ID of a new row added to a table?...
|
|||||||
| PHP PHP - The most popular scripting language. Discuss PHP related questions here. Sample Scripts, Popular downloads, tools and utilites and more... |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
Re: How do I find the ID of a new row added to a table?
Hi,
Here's the script. <?php $q = mysql_query("INSERT INTO mytable VALUES('test')"); $rownumber = mysql_insert_id(); //$rownumber contains the id of the new row ?> Regards, Riju. |
|
|||
|
Re: How do I find the ID of a new row added to a table?
hi,
here is another method if you id is auto incremented then. $sql="select max(id) from table "; |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Query to find structure of a table | Geek_Guest | SQL | 16 | 07-07-2009 04:35 AM |
| How to find Table Size | timmy | Oracle | 2 | 09-23-2008 04:52 AM |
| How to find a max number in a row of a table. | ganesh.b | SQL | 1 | 07-25-2008 08:01 AM |
| How can I find the name of the function for a particular table | Geek_Guest | Oracle Apps | 0 | 06-22-2007 03:05 AM |
| How to find Defined key fields in a table? | sharifhere | SQL | 2 | 02-22-2007 01:01 AM |