Jump to content

Adding values to an exiting row


Poddy

Recommended Posts

Hi, i currently have an html form which is supposed to send data inserted into the database, the problem is

that i want to insert values in an exiting row created earlier while the values i want to insert are currently null

if i insert the entire row it works fine..

the table is built as the following:

 

user_id      q1        q2        q3        q4

12345      ans1      ans2    ans3      ans4

 

i have tried using the

INSERT INTO table WHERE user_id='12345' (q1, q2, q3, q4) VALUES (val1, val2, val3, val4)

but it dosent work, however if  i add the user id WITH the other values is works.. but this is not what i want it to do...

i want to have a database of users id's and when they answer on forms questions that data is sent to the database as the following..

 

should i use the update command instead? even that they are null

if so how can i update multiple fields together in the same update query?

 

Link to comment
https://forums.phpfreaks.com/topic/91034-adding-values-to-an-exiting-row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.