hi
Can I check with all of you how to transfer sql "table1" pid row number 2 to "table2" pid highest row. Like say my "table2" highest row currently at pid 11, so it will transfer to number 12.
thank
transfer sql "table1" to "table2"
Moderator: General Moderators
Re: transfer sql "table1" to "table2"
try the databases forum.
Re: transfer sql "table1" to "table2"
Use mysql_insert_id to retrieve the last id. Be careful it only works good in no race environment (i.e. multiple users updating the same tables) and must one auto increment column.
Re: transfer sql "table1" to "table2"
Moved to Databases.
mysql_insert_id() works fine in race conditions, because that function returns the last inserted ID [em]for your connection[/em] not for the table. If you've got 20 people updating the table & the all call mysql_insert_id(), they'll all get 20 different numbers.
mysql_insert_id() works fine in race conditions, because that function returns the last inserted ID [em]for your connection[/em] not for the table. If you've got 20 people updating the table & the all call mysql_insert_id(), they'll all get 20 different numbers.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: transfer sql "table1" to "table2"
thank
but I think that is not the solution bec I just want to transfer one row from table1 to table2 in mysql . Use something like trigger is it??
pls help
but I think that is not the solution bec I just want to transfer one row from table1 to table2 in mysql . Use something like trigger is it??
pls help