This is in a php webpage
I have a link coming in as www.example.com/add_new.php?code=1234[]&code=4321[]&code=4263[]&attend=1
I need to update the database for code
mark attend as attend="1"
I can get it to work if I just have one. But when I have more than one can I loop this to edit all values?
$codes = $_GET['code'];
foreach ($codes as $code) {
$sql = "UPDATE guests SET attend='$isattend' WHERE code=$add";
}
what is the correct syntax for this?
Right Now it only applies the last on code=4263[]
and marks 4263 as attend=1
but I need foreach
Thanks.