problem with mysql
Posted: Tue Apr 20, 2004 4:32 am
hi all,
got a little problem again. my table is as follows:
---------------------------------------
id | bnummer | model | width ....
---------------------------------------
id is autoincrement, bnummer is the ordernumber (i'm creating a shopping cart) now the problem is: when a customer visits my shop and he adds his first product to his cart, i used: to get the last added id and its corresponding ordernumber(bnummer). then i want to add 1 to the bnummer, to make sure it's a new order, not the same order as last time he visited.
when my table is completely empty, the first record i adds gets bnummer 11, the second one i add gets bnummer 0
this just won't work, can somebody help me?
grtz
RuffRyder
got a little problem again. my table is as follows:
---------------------------------------
id | bnummer | model | width ....
---------------------------------------
id is autoincrement, bnummer is the ordernumber (i'm creating a shopping cart) now the problem is: when a customer visits my shop and he adds his first product to his cart, i used:
Code: Select all
$bestelnr = mysql_query("select bnummer from bestdetl order by id desc limit 1",$conn) + 1;when my table is completely empty, the first record i adds gets bnummer 11, the second one i add gets bnummer 0
this just won't work, can somebody help me?
grtz
RuffRyder