I'm desinging a database as part of my archaeology masters in GIS I've been teaching myself apache server, php, mysql, html for the last month and now i have got stuck: The database has an auto incremented ID number how ever when i update the row each row gets written over therefore i want to set th primary key to the ID as well as a cookie - any ideas on how to do this? so far i have <?php setcookie(time()+3600); ?> This needs to be stored and remembered on each page so i assume i will need some kind of sql I have to tell the db that the newly created id no. is linked to the cookie so that all information from that user stays in the single row and does not over right any of the other data Thanks for you help Gary Nobles
im not quite sure that i understand the situation. though instead of inserting a new row you might want to look into the mysql REPLACE syntax. http://dev.mysql.com/doc/refman/4.1/en/replace.html and ther is always mysql_insert_id() which will return the last auto_incremented id generated in the database.