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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.