Lets say that userid '1' have 5 records in this table with the order_number 1 to 5. Now I want to make the next record the user inserts to be number 6. The table have other users also with numbers starting from 1 and so on.... How do I look into the DB before inserting and exactly add the next number in line for that user?!?
As it is now I inserts the records like this:
Code: Select all
$result = $db->sql_query("INSERT INTO ".$prefix."_cat_user (uid,catid,background,color,admin,order_no) "
." VALUES('$userid','$my_random_id','$color','$textcolor','1','')");Thanks for any help.