ID for post

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
yoji
Forum Commoner
Posts: 25
Joined: Sun Oct 19, 2008 3:09 am

ID for post

Post by yoji »

I am creating this blog. My question is that how can I get the id (which is primary auto) of the post i JUST made??? Now, I can't use WHERE to compare the post itself with the database to get the id... How can I do it???

Take it as this: If you had 3 columns in a table, ID, TITLE,MESSAGE. Where ID is primary auto. If you insert a record in the database, how can you now find out what ID did it get? Considering that the Title field CAN be NULL. I don't think comparing the whole message is a good idea.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: ID for post

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
yoji
Forum Commoner
Posts: 25
Joined: Sun Oct 19, 2008 3:09 am

Re: ID for post

Post by yoji »

Wow thanks a million... Didn't knew that one...
Post Reply