Mysql updating multiple rows
We can get selected checkbox values via j Query AJAX post or by accessing the form from PHP after page refresh.While implementing multiple rows update or delete, we need to follow some steps.// Users Only take the survey 'foobar' once, and can // edit the answers if and only if they have not completed the survey.table_member ( member_id, taking Foobar, foobar Completed, foobar Start Time, foobar End Time ) //foobar is actually a "results" table.For that, we need to make two main changes with the edit_user.php, we have seen in PHP CRUD. So, on submitting this multiple user information, an array of user information for each user, will be passed to PHP code.
With these steps, we should make little changes on list_and edit_
After successful update, the page will be redirected to list view by using PHP location header. Because we need not show any user interface and it requires only the array of selected row ids.
I want to UPDATE a field of table with the results of another query, (sub query), but my sub quesry contains a Group By and so returns multipel rows.
UPDATE TABLE_ONE SET TOTAL_SALES =(SUBQUERY) The Subquery: Select COUNT(*) from TABLE_TWO where TRANSACTION_TYPE="SALE" GROUP BY PERSON_ID QUERIES together UPDATE TABLE_ONE SET TOTAL_SALES=(SELECT Count(*) FROM TABLE_TWO GROUP BY PERSON_ID) This Subquery return multiple rows and hence teh ORA-01427 error.