What's the most efficient algorithm for a function that tries to insert an entry... if the entry already exists, it returns the id of that already existing entry, else it inserts the new entry and returns the id of the new entry?
Thanks for the help
What's the most efficient way to accomplish the following problem:
I have a table called: dogs
Attributes: did (primary key, auto increment), name
if I run this query within PHP:
INSERT INTO dogs (name) VALUES ("bob")
How can I echo the "did" of the newly inserted dog?
Thanks for the help!
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.