From: Asendorf, John
Sent: Monday, January 14, 2002 4:49 PM
>You can, but there are a number of issues to deal with. One of the
>potential solutions is to grab the MAX value from the table id field and
>then increment that number for the next inserted record. The problem
arises
>though when you
Hi,
yes, you can. If you're using MySQL try to use
mysql_insert_id function - it should solve your
problem.
For more explanations and examples - see manual:
http://www.php.net/manual/en/function.mysql-insert-id.php
and for all mysql functions:
http://www.php.net/manual/en/ref.mysql.php
Greeting
That's what I originally did but it can create loads of problems if you
remove entries from the database or something similar.
Is it SQL you're using? If so then i BELIEVE that there is a way of
defining a field to do this automatically, instead of calling a field
'int' or whatever, I remember t
> Sent: Monday, January 14, 2002 10:48 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Unique id Number
>
>
> OK...newbie question it must be:
> I want to add an entry into a db tb (using php obviously) and
> when its added
> into the db its gets a sequencially numberred
OK...newbie question it must be:
I want to add an entry into a db tb (using php obviously) and when its added
into the db its gets a sequencially numberred idnow can I retrieve this
id numbe rin the same php coded page as what I create the entry with? If not
what is the best way around it? Cre