aashish Posted March 22, 2006 Share Posted March 22, 2006 [b]i want to access a Table , pick those values and dump into another table values,then again when sending the value and dumping it over again, in the process , it needs to delete the existing valuesAssume u have 2 tables A n Bthe contents of table A need to be dumped to Bthen when u do the process the second time from A, the contents in B need to be deletedthanks to al of u inadvance!please rememeber it is an update sort of transaction..crack this if u can..[/b] Quote Link to comment https://forums.phpfreaks.com/topic/5511-guys-solve-this-if-u-can/ Share on other sites More sharing options...
obsidian Posted March 22, 2006 Share Posted March 22, 2006 sounds like you're basically running a backup script of one table. if this is the case, you really could just do an INSERT from SELECT. i'll try to illustrate it here:[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--]/* first, clean out the backup table */TRUNCATE TABLE backupTable;/* now, [span style=\'color:blue;font-weight:bold\']insert[/span] all the records */[span style=\'color:blue;font-weight:bold\']INSERT[/span] [color=green]INTO[/color] [color=orange]backupTable[/color] (field1, field2, field3) [span style=\'color:blue;font-weight:bold\']SELECT[/span] a.field1, a.field2, a.field3 [color=green]FROM[/color] [color=orange]origTable[/color] a;[!--sql2--][/div][!--sql3--]hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/5511-guys-solve-this-if-u-can/#findComment-19694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.