Dynamic web record
I'm trying to build a simple app:
Six columns with these values
Nr, Name, checkbox 1, checkbox 2, checkbox 3, checkbox 4.
The checkboxes are project stages. I'm using MySQL to store the data and retrieving it to a webpa开发者_如何学编程ge with PHP.
My problem is on how to go updating the checkboxes, and also how to filter the results (display only records with checkbox 1 checked).
Or can anyone recommend other solutions/platforms?
This is not overly complex I thought someone must knew a better or easier way to do this.
After your sql query, something like this would work:
if($row['checkbox1'])
echo "<INPUT TYPE=CHECKBOX NAME=checkbox1 CHECKED>";
else
echo "<INPUT TYPE=CHECKBOX NAME=checkbox1>";
Query for filtering:
select * from table where checkbox1 = 1;
<input type='checkbox' name='aname' value='avalue' <?php
if(isChecked($dbrow, $itemname)) // you write this function
{
echo "checked='checked'";
}
?>/>
精彩评论