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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mysql insert query

    hi,

    i have 2 mysql tables

    first one is user table and its fields are as follows
    id--userfield1--userfield2--userfield3
    1--87878978--56564545--53342323

    second table is user_values and it's fields are
    user_id--field_id---field_value

    1.here i want to write a insert query such that i can fetch the id from users table and store in user_values.user_id

    2.the field_id value should be 1 for userfield1 and 2 for userfield2 and 3 for userfield3 in user_values table

    3.fetch the userfield1 value from user and store it in field_value of user_value.finally user_values table should like this

    user_id--field_id---field_value
    1---1---87878978
    1---2---56564545
    1---3---53342323.
    2---1---99999999
    2---2---88888888
    2---3---66666666
    i have 10 records in user table.how i can fetch and store these values.please guide me how i can do this.


    thankig you
    mrjameer.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    contact the PHP moderator, have them move the thread to the mysql area. you don't have a PHP question. please ask your questions in the appropriate forum.

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,


    i want to do this by using php.sorry i have forgotten to add this word.please help me.your help will be surely appreciated

    thanks
    mrjameer


  •  

    Posting Permissions

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