[PHP-DB] auto-generating next id (in order) for an add script

2005-06-20 Thread tramelw
Hello, I have a site that allows reporters to enter their articles into a forum. I am then spilling their articles onto the main page from a MySQL dbase via a php script, read LATEST ARTICLES. I am now entering the data myself after they email it to me, however this is becoming more of a

RE: [PHP-DB] auto-generating next id (in order) for an add script

2005-06-20 Thread Bastien Koert
post your code and db structure, it might be simpler to use an auto increment value and let the db do the work in assigning the next number... bastien From: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] auto-generating next id (in order) for an add script Date: Mon, 20 Jun 2005

Re: [PHP-DB] auto-generating next id (in order) for an add script

2005-06-20 Thread Micah Stevens
Use an autonumber field in MySQL. It will increment automatically every time you insert a record, and not repeat numbers. No extra PHP code needed. After the insert query, you can then issue a mysql_insert_id() function that will return the autonumber field for the last insert, that way you

Re: [PHP-DB] auto-generating next id (in order) for an add script. .

2005-06-20 Thread Patel, Aman
I'd recommend you use what mysql provides for this. Auto_increment flag. Here's more information on how to make your id column be an auto_increment primary key. http://dev.mysql.com/doc/mysql/en/example-auto-increment.html - Aman Patel, Sys Admin / Database / Web Devloper, International

Re: [PHP-DB] auto-generating next id (in order) for an add script. .

2005-06-20 Thread tramelw
:27:01 -0500 Subject: Re: [PHP-DB] auto-generating next id (in order) for an add script. . I'd recommend you use what mysql provides for this. Auto_increment flag. Here's more information on how to make your id column be an auto_increment primary key. http://dev.mysql.com/doc/mysql/en

Re: [PHP-DB] auto-generating next id (in order) for an add script

2005-06-20 Thread tramelw
: [PHP-DB] auto-generating next id (in order) for an add script post your code and db structure, it might be simpler to use an auto increment value and let the db do the work in assigning the next number... bastien From: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] auto

Re: [PHP-DB] auto-generating next id (in order) for an add script

2005-06-20 Thread Miles Thompson
. Again, thanks everyone. -Original Message- From: Bastien Koert [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php-db@lists.php.net Sent: Mon, 20 Jun 2005 13:30:13 -0400 Subject: RE: [PHP-DB] auto-generating next id (in order) for an add script post your code and db structure, it might