I am inserting records into a table. The 2 fields that are relevant here are the fields I made: "RecordID" and "ItemID"
RecordID is the tables primary key with an auto-increment.
ItemID is specific to the table varchar(255).
Is there a way I can insert the primary key value into ItemID also.
If the next increment being inserting into the RecordID is 5 then I want the ItemID to be "000005". All I need is to be able to get the increment number then format it to ItemID. Formatting is not a problem, I just need to be able to get the increment number (during insert)
$SQL = "INSERT INTO items (RecordID, ItemID)";
$SQL .= " VALUES(NULL, '$ItemID')";