Hi Cynthia,
how do I go about selecting only the most recent Rescuer_ID that was created?
mysql_insert_id () returns the last inserted id
Not sure how to do this. I assume I need to query that table for the Rescuer_ID that was just created...
A Dog can be rescued by a Member
When a Member decides to rescue a Dog, it becomes a Rescuer.
So you need 3 tables: Dogs, Members and Rescuers. You don't need a Connect table. The Rescuers itself is the "Connect" table. A Rescuer is defined the its member id and the dog id, it wants to save.
Rescuer = MemberId, DogId
So if someone wants to save 101 dogs, the Rescuer will contain 101 entires, with the same MemberId but 101 different DogIds !
What do you think ? No more Connect table 🙂
I do have an Entered Date field in there, so can most likely get the most recent one
Don't use the Date, it doesn't UNIQUELY identify your Dogs, Members or Rescuers.
Is there a Where clause where I can get the most recent date? Hrm... I'm looking in the MySQL documentation for this too
Beginner question! You should be ashamed, kidding :p
You should chapter 3 "3 Tutorial Introduction" from the MySQL manual, it will really help you!
To get the most recent date, you have to ORDER your query. Check the SELECT statement syntax for more information:
SELECT * FROM Dogs ORDER BY InsertDate
Dogs = Id, InsertDate, Name
I hope it helps!
JM