When I insert a new entry into a MySql table which has an ‘id’ column that is auto-incremented, can I return the new id value?
What I have is something like this:
If you want to keep the current ID, you will need to store it in a session cookie because using lastInsertId() won’t last for long.
Let’s say you created someone and incremented the number to 1. If you’re still on the page and someone happens to come by and increment a new number to let’s say 2. The number you will be using is 2, not 1.
I would think they are not the same. Count will say how many entries there are, last id will give the last entry, which will not necessarily be the same, as some entries may have been deleted.
[quote=“DaveMaxwell, post:11, topic:211409, full:true”]this was solved - I’m not quite sure why it’s continuing on…
[/quote]
or why it wasn’t in the php forum in the first place