SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to move rows from table to another table in MYSQL?

    Hello, I have writed a script in php but need to move some rows from a tabel to another. I can of course get the data from one table and insert to another but can it be done another ways?

    thanks

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    INSERT INTO `new_table` VALUES (SELECT * FROM `old_table`)
    If you want to do this with MySQL then why not post in the MySQL forum?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •