Update multiple data entries update 'article' set ppercent = '". $ weihbl. "'Where userid in ('". $ sid. "') AND aid in ('". $ aid. "') and sta in ('0 ')").
Dear friends, I want to set ppercent in the articles table that meets the preceding three conditions to the same value. Therefore, it is to update multiple data records. it seems that this sentence is incorrect, what should I do? Thank you !!
Reply to discussion (solution)
You should print the variables to see if the syntax is correct. You 'd better check the generated SQL statement and run it in the MySQL tool to see what error is reported.
What's the problem?
SQL command syntax error
Or is the actual result different from what you expected?
There should be three data entries that meet the condition, but one is updated. Thank you.
1. print the SQL command
2. provide relevant data
There should be three data entries that meet the condition, but one is updated. Thank you.
It is possible that there are three matching data records, but the ppercent value of the two data records has not changed, so there is only one influence.
How can I print SQL commands? I know this is a weak problem.