I have a php script that shows all the data in a table. I want it to have check boxes next to each line of this data that it puts out, so I can check the boxes next to certain entries, and when I click submit, the "have" collumn for those entries is set to yes.
Here is most of the script that shows the list:
To try to help out whoever helps(becuase I honestly have no idea how to do this) The MySQL query to put Yes in the Have column would be similar to this:
Here is most of the script that shows the list:
Code:
$query="SELECT * FROM get ORDER BY artist,name ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Name</font></th>
<th><font face="Arial, Helvetica, sans-serif">Artist</font></th>
<th><font face="Arial, Helvetica, sans-serif">Album</font></th>
<th><font face="Arial, Helvetica, sans-serif">Have</font></th>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"name");
$f2=mysql_result($result,$i,"artist");
$f3=mysql_result($result,$i,"album");
$f4=mysql_result($result,$i,"have");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
</tr>
<?php
$i++;
}
?>
</body>
</html>
Code:
UPDATE get SET have = YES WHERE name = $CheckedRows
Comment