Here is the problem:
1-I've a table in my database named: mt_entry
2-This table has these fields: entry_id, entry_category,entry_text,title,date and so on...
3-I know to sending information via a form to this database, I can use a insert query.
But each time a user visits the form page to send a new entry to database, I need that a php code gets the last entry's id and adds 1 to it and put this id inot a hidden input inside the form,named "entry_id".
My question is that: how should I write such a code segment? and how can I be sure that every time a user sends an entry to database it will get a unigue id (the last entry's id + 1)?
select and insert from form to database
Moderator: General Moderators
no knowledge of php
simply because I have no knowledge of php and sql queries. When I said I know how to insert details in database, because I've some written php code examples. Can you please write me the required code?Thanks in advance
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Re: no knowledge of php
No, I'm not here to do the work for you. I can direct you in the right direction.erinther wrote:Can you please write me the required code?
http://dev.mysql.com/doc/refman/4.1/en/alter-table.html