Jump to content

[SOLVED] Inserting new record +1


liquinas

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/39970-solved-inserting-new-record-1/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.