A no doubt elementary question, but ....

using PHP and MySQL, I'm inserting a record into a table, with a field,
order_number, being auto incremented ... something like:

$sql = "INSERT INTO orders set products_ordered='$products',
ordered_by='$username', company='$company', address_1='$address_1',
address_2='$address_2', city='$city', state='$state', zip='$zip',
attn='$attn', special_instructions='$special_instructions',
shipping_instructions='$shipping_instructions', status='$status',
rush='$rush', date_ordered='$current_time' , month_due='$month_due',
 " ;

$result = mysql_query($sql) or die("ERROR -- try again");

Having done so, how can I immediately determine the  value of order_number
for this entry, i.e. the auto-incremented value assigned by MySQL?

Thanks in advance for the help.

Kenn Murrah

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to