liquinas Posted February 24, 2007 Share Posted February 24, 2007 Hi, this is pretty simple, I have $query = "INSERT INTO Cars (ID) VALUES ($ese)"; $result = mysql_query($query) or die ("Problem with Query. Contact [email protected]"); On the table the field ID is primary key. There are 6 record on the table with IDs 1-6. I need $ese to equal the highest ID +1 so that if I hit the button and run the query, record #7 would be inserted, and so on. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/39970-solved-inserting-new-record-1/ Share on other sites More sharing options...
Yesideez Posted February 24, 2007 Share Posted February 24, 2007 When inserting a new record MySQL will automatically increase the primary key by one every time you add another record. Quote Link to comment https://forums.phpfreaks.com/topic/39970-solved-inserting-new-record-1/#findComment-193287 Share on other sites More sharing options...
liquinas Posted February 24, 2007 Author Share Posted February 24, 2007 I totally knew that >.> <.< Quote Link to comment https://forums.phpfreaks.com/topic/39970-solved-inserting-new-record-1/#findComment-193291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.