--- Brian E Boothe <[EMAIL PROTECTED]> wrote:

> hi all :
>   i want to Autogenerate a Issue_id number everytime the Add issue page 
> Comes up to add a Issue,, how could i do that Including the date  like 
> today would be
>     6132008     thanks

In MySQL an INT field can be given AUTO_INCREMENT and PRIMARY KEY properties. 
If a row is added with a 0 or null value for this field, it will receive the
next highest value which has not yet been assigned.  On a regular signed INT,
this range goes from 1 to about 2.1 billion.  If you need more, look at
datatypes like UNSIGNED INT or BIGINT.

Once the row is added, the PHP function mysql_insert_id() will return the
latest value for this AUTO_INCREMENT field.  There is also an equivalent MySQL
function with the same name, mysql_insert_id().

If you want to use the number on the report form screen, INSERT a minimal entry
and get the mysql_insert_id() value.  Use UPDATE to add data from the form to
the existing record.

James

Reply via email to