I am pulling my hair out...
I know that the answer to this is obvious, but i can't for the life of me see it.
I have a table called order_seq which is essentially a table merley to substitute for a sequence.
It's purpose is simply to provide me with invoice numbers. all i want to do is increase the auto-increment and the return the value with last_insert_id() and then use that number to insert into another table.
here is my code
// increase the sequence with an insert
$incrId= mysql_query("INSERT INTO order_seq (order_id) VALUES (0)");
// get the sequence number and echo it.
$get_invoice_id = mysql_query("SELECT distinct last_insert_id() FROM order_seq as invoiceID");
while ($row = mysql_fetch_array($get_invoice_id, MYSQL_ASSOC))
{
echo $row["invoiceID"];
}
the error i am getting is:
Notice: Undefined index: invoiceID
any help appreciated...
cheers,
Mitch.