Log in

View Full Version : Retrieving checkboxes values from mysql



batowiise
01-24-2011, 03:24 PM
Hi All,

I have been able to insert a checkbox value into my database. The problem i am now facing is how to retrieve the value of the checkbox in the form of a TICK.

Your help will be much appreciated.

Regards.

bluewalrus
01-24-2011, 05:25 PM
You could do it like this


<input type="checkbox" value="checked?
<?php
if ($value_from_db == 1) {
echo "checked" }
?>
/>