YOU I need to chat with you about sql security/methods sometime... soon
no I'm unsure about how to implement something I currently do manually through a form. it involves dumping data from one table to another, amending the id numbers for continuity (so the table that's being
dumped continues from the number it finished with) and then emptying the table
well I say form, I mean button
I want someone to be able to do it without manually typing all the SQL
and you make table B and you want the 50 records from table A to be put in table B
do you already have table B with like 200 records
and you want records 201-250 to be the stuff in table A
no they're contradictory things
either table B already exists or it doesn't
what exactly is it you need to do
as far as I can understand you have a table A that has a number of records, say 1-30
and you have a table B which can have any number of records
and you want to tack the records in table A at the end of table B
if that is what you need to do you just need to grab data from A and insert into B with a loop, and ignore any IDs in A since when you insert into B, it'll automatically apply IDs that follow B's order
if you have AUTO_INCREMENT on table B set to on
so if A has 50 records and B has 0 records you'll get IDs 1-50 in B
and if A has 50 records and B has 200 records you'll get IDs 201-250 in B
just ignore the IDs from A, and don't specify an ID when inserting into B, and it'll automatically add the IDs for you
okay, excellent, that seems workable. do I need to code deleting/emptying the line into the loop? ie. loop goes "grab data, dump into table B, erase data, repeat until no more datas"?
also sorry I misread one of the options you offered but you seem to understand what I am doing, haha...
nah you can just empty the entire table at the end there's a command for it
i just.. forget what it is
TRUNCATE TABLE tablename;