ok, i'm trying to write a script that uses mysql......i need to chesk the field "post_id", but i want it to check the value of "post_id" at the bottom or last row
so wait, i have to add another field to my news table, then what would i do put the same number in that as i do in the "post_id" i started it at one, and what i want to do this for is to see how many posts there are and then make the new post's "post_id will be one greater then the one before, heres my table setup......
post_id | subject | date | post_text
i can add another field if i have to but i dont really want to, could i not just do
hmm...you dont want to add another field? why? it wont bite you.
all you need is a ID field, so it becomes
ID | post_id | subject | date | post_text
the ID field needs to be INT, with auto_increment. with this, you dont need find the total number of rows and then add 1 for post_id, beacuse ID will do this for you.
you can just change post_id for this, it doest HAVE to be called ID.
just make the post_id field into
INT, primary, auto_increment.