I have 2 tables that are related. I dont want to assume that the last record is the one I just created as Murphys law states that a nanosecond after i create the record someone else will create another. This means that the last record may not be the one i created.
Now, im trying to decide the best way of doing this. I have created a multidimensional array using the mysql call:
SELECT * from table ORDER BY DESC id
I want to compare the contents of the record with the variables i still have in memory to see if it is the same record. Now my problem is, what is the best way of doing this. Or does someone have a suggestion for a better way?
I was thinking of a foreach loop or a for loop, but can u BREAK out of these? Maybe a while loop and set a variable when the true condition is met?
My brain is melting and would appreciate the help.
Thanks