I would like to select the first x rows say 10 before an insert. If there are no rows before the insert then it just returns the row that has been inserted
After an insert I am able to get the id by using mysql_insert_id();
Is the an intelligent way to select the first 10 rows before this insert.
This must work for any number within the interval 0 or 10. So suppose they are 7 rows before the insert then it would just return 8 rows.
I was thinking of using limit like so
$insertid = mysql_insert_id()
$postid = 200
Select a, b, c from mytable where a = '$postid' limit $insertid 10 order by b
but this doesn't work like I assumed.