Jump to content



  • Please log in to reply
1 reply to this topic

#1 aashish

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 March 2006 - 04:25 PM

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 values

Assume u have 2 tables A n B

the contents of table A need to be dumped to B
then when u do the process the second time from A, the contents in B need to be deleted

thanks to al of u inadvance!

please rememeber it is an update sort of transaction..

crack this if u can..

#2 obsidian

  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 22 March 2006 - 04:49 PM

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 */

/* now, [span style=\'color:blue;font-weight:bold\']insert[/span] all the records */
[span style=\'color:blue;font-weight:bold\']INSERT[/span] INTO backupTable (field1, field2, field3)
[span style=\'color:blue;font-weight:bold\']SELECT[/span] a.field1, a.field2, a.field3 FROM origTable a;

hope this helps
You can't win, you can't lose, you can't break even... you can't even get out of the game.

while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users