i’m making a CMS and i have a list of textbox’s, each containing a value from the DB. how can i set a unique name to each textbox and then know when to update it when it’s corresponding checkbox has been clicked?
so what it looks like is
[CODE]
<td><?=$rows[0] //class?></td> <td><?=$n?></td> <td><input type = “text” size = “1” name = “newdays<?=$rows[2] //emailid?>” value = “<?=$rows[1] //days?>” name = “days”/></td> <td><input type = “checkbox” name = “emailid[]” value = “<?=$rows[2]?>”></td> <td><?=$rows[2]?></td>
so each text bos has the name newdaysXX, XX being a unique ID from the DB. the problem is i can’t reference it later on, what i was trying to do when updating it in the for loop was:
[CODE]$query = “UPDATE email_content SET days = [B]$_POST[newdays”.$days_emailid[$i].”][/B] WHERE class = ‘$_GET[class]’ and emailid = $days_emailid[$i]”;
(the reason there’s a $days_ prefix is because i used import_request_variables(“gp”, “days
but whenever i try using the query i mentioned, i get the error Parse error: syntax error, unexpected ‘”‘, expecting ‘]’ in /home/admin/changestage.php on line 22
any suggestions?