retrieveing last index made

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
trent2800
Forum Commoner
Posts: 48
Joined: Mon Oct 02, 2006 7:02 am

retrieveing last index made

Post by trent2800 »

I have a MYSQL DB that has a Primary Index that auto increments. So, when I add a new artist to the db I have a query like this:

$query = "INSERT INTO `ARTISTS` (`FirstName`, `LastName`, `Phone`, `Address1`, `Address2`, `City`, `State`, `Zip`, `Email`, `Process`, `About`) VALUES ('$FirstName', '$LastName', '$Phone', '$Address1', '$Address2', '$City', '$State', '$Zip', '$Email', '$Process', '$About')";

Now, after I add that artist, I would also like to upload an image of that artist for that personal touch. How do I call up the index that was just created for that row so I can name the new image with that key (eg 1.jpg, 2.jpg, etc..)?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
trent2800
Forum Commoner
Posts: 48
Joined: Mon Oct 02, 2006 7:02 am

Post by trent2800 »

Thanks, cant believe i missed that... I was staring at the mysql functions... ohh well.
Post Reply