foxache
01-29-2004, 05:01 AM
Hi. I'm still slugging along with the same old things, but here's a quicky.
Why doesn't this work????
<?
$query = mysql_query("SELECT * FROM $tb ORDER BY category ASC");
while ($name = mysql_fetch_array($query)) {
print "<div align=\"left\">
<input type=\"checkbox\" name=\"delete\" value=\"$name\">";
print $name['table'];
}
?>
What it should do is output a list of categories with checkboxes. Each checkbox is an option to delete that category. So the name is "delete" and the value should be the category name. Then when submitted the script will delete it from the table. I couldn't work out why it wasn't deleting anything until I realised the problem was that the value of the checkbox allways returns as "Array" when I viewed the source, and not the name of the category...
Anyone?
Thanks.
Why doesn't this work????
<?
$query = mysql_query("SELECT * FROM $tb ORDER BY category ASC");
while ($name = mysql_fetch_array($query)) {
print "<div align=\"left\">
<input type=\"checkbox\" name=\"delete\" value=\"$name\">";
print $name['table'];
}
?>
What it should do is output a list of categories with checkboxes. Each checkbox is an option to delete that category. So the name is "delete" and the value should be the category name. Then when submitted the script will delete it from the table. I couldn't work out why it wasn't deleting anything until I realised the problem was that the value of the checkbox allways returns as "Array" when I viewed the source, and not the name of the category...
Anyone?
Thanks.