Ok, i have a checklist system that i am working on. There is a page that pulls data from the database and displays it as a checklist. I am trying to create a button that when pushed will reset the database to a certain state that i want. Basically, i have a button that sends an ajax callout to a php page that executes an UPDATE query. This query is as follows:
UPDATE $table SET value='$value', comments='$comments', editedBy='$editedBy', editedDate='$editedDate' WHERE projectId='$projectId';
I set the variables first of course, that's not my question. Just pretend they have data. My question is how can i repeat this query so that every row table x that has a projectId of n is updated? I'm guessing this involves a for loop?
SIDE NOTE: Since this query is just setting the value to false and making the comments, editedBy, and editedDate fields blank for every row in table x that has a projectId of n, is there a better way of doing this other than the UPDATE query?
Thanks for any help!