Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    97
    Thanks
    2
    Thanked 0 Times in 0 Posts

    duplicate table record

    Hello, inside the table vid I have the records name, desc and tag, I would like to create a record named file that contains exactly what name contains, do you know how cai I do this?
    I searched for 2 hours but no method worked

    Thank you!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    What do you want to do? Is this file a field in a db table?

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    97
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Yes file is the record I would create, it is like name, desc and tag.
    They all are inside the table vid, file must contain exactly what name contains.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    So it's a field or a record? If its a record, I'm not sure what you intend to do in relation to the other fields. If its a field, a simple UPDATE vid SET file=name would suffice.

  • Users who have thanked Fou-Lu for this post:

    paperino00 (04-18-2012)

  • #5
    New Coder
    Join Date
    Nov 2011
    Posts
    97
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I don't know the exact terms of a database... In phpmyadmin you open the database and at the left there are the tables. Click on a table (vid in my case) and in "Structure" you see Field, type, collocation, extra etc.
    Under Field there are what i call record of a database (name, desc and tag in my case).
    I just want to duplicate one of this record or field (name) and put the copied content inside another record (file) that originaly contains nothing. file must be with the same settings of name... duplicate withou touching the original name record.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Then its a field yeah. Add the field for file, and execute the update statement above to populate it with the name.

    Edit:
    Make sure its the same datatype and size of the name as well.

  • #7
    New Coder
    Join Date
    Nov 2011
    Posts
    97
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you works


  •  

    Posting Permissions

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