A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: easy way to copy a mysql table?

  1. #1
    Running Plodding & Limping SpockBert's Avatar
    Join Date
    Jun 2002
    Location
    London
    Posts
    593

    easy way to copy a mysql table?

    I have a table full up with crap entries like "please work", "this time pleaase" etc etc

    I have about 60 off rows of rubbish that I need to delete. Now if I delete the lot the new ID will still #61 right?

    Not that its a big deal but is there any simple way of copying a tables structure but not the actual records? So I'd have a nice clean table with ID starting with 1 etc.

    I'm using phpMyAdmin if that helps.

  2. #2
    Running Plodding & Limping SpockBert's Avatar
    Join Date
    Jun 2002
    Location
    London
    Posts
    593
    ah nevermind, done it now

  3. #3
    Member
    Join Date
    Dec 2004
    Posts
    53
    Hi there,
    You could use TRUNCATE like so:
    PHP Code:
    $deleted_rows mysql_query("TRUNCATE TABLE table_name"); 
    Cheers.

  4. #4
    Running Plodding & Limping SpockBert's Avatar
    Join Date
    Jun 2002
    Location
    London
    Posts
    593
    I was just playing with the "operations" bit and there was some options to copy just the structure..perfect!

    thanks for replying though

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center