deleting the last inserted row in DB
Posted: Sat Apr 02, 2005 1:52 am
hey all
I have a dream that it one day would be possible to use the following code snippet
but it's not working. Probably because of the wrong use of the MAX-function(at least that's what mysql_error() tells me)
So is it really necessary to count the rows, set $id=count_result and then delete where id='$id', or is there another smarter way of doing it?
thallish
I have a dream that it one day would be possible to use the following code snippet
Code: Select all
// the newly inserted row in table 'education' is deleted
$query = "e;DELETE FROM table WHERE id=MAX(id)"e;;So is it really necessary to count the rows, set $id=count_result and then delete where id='$id', or is there another smarter way of doing it?
thallish