Tuesday 15 March 2011

php - Updating multiple fields in table -


My question is what should I do instead of doing it

I am developing many online questionnaires with many questions and so many answers in each Q & A.

People can return to question by a certain date so that one can be added and many updates are necessary.

Does one normally check to see that the answer has changed since the data was read from the table or only the changes have been updated or all of the table shown on the questioner Change the data. For example, if a person selects radio button 1 instead of 2, then I must update all the fields

Justin

No, you can update a column at a time, for example, using a PDF statement, using

  $ Dbh = new PDO ("mysql: host = $ dbhost; dbname = $ dbname", $ dbuser, $ dbpass); $ Sql ​​= "Update survey 222 SET Question_43 = WHERE user_id =?"; $ Stmt = $ dbh- & gt; Ready ($ sql); $ Stmt- & gt; Execute ($ new_answer, $ user_id));    

No comments:

Post a Comment