...

View Full Version : mysql insert query



mrjameer
11-20-2006, 09:00 PM
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.

guelphdad
11-20-2006, 11:32 PM
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.

mrjameer
11-21-2006, 01:12 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum