Sindhu Kavuri

Sindhu Kavuri

  • NA
  • 98
  • 12.3k

how can insert values simultaneously into table

Feb 27 2018 2:34 AM
my doubt is i want to insert userid and checkbox values based on userselection then i also want to insert username from anoter table based on the similarity of the userid
 
for example  my table users 
 
it has userid ,username passwd, email.. here userdid is PK 
 
 userid username password email
 1 sindhu ...... [email protected]..
 2 sama .... [email protected]
 second tblee mood --
 
here i will take userid and mood from the user after his selection
so, now after his selction of userid , i want to insert the username which is related to the selected userid ..
 
like the below table 
 
 userid mood username
 1 happy sindhu
 
i think i have to make userid in mood table as FK and then how can i get username 
i am getting confused..Any Help is Appreciated .
Thanks in Advance.
 

Answers (2)