checkbox

From: Date: Sat, 25 Nov 2000 19:51:16 +0000
Subject: checkbox
Groups: php.general 
Request: Send a blank email to php-general+get-27170@lists.php.net to get a copy of this message
I know this should be simple to figure out but I am stuck. I have three check boxes on a form all for different things. When I check them or don't check them they add ether yes or no to the database field corresponding to them. This is what I want them to do. My problem is when I pull the data back in to a form for update or viewing. I can not figure out how to make the check boxes be checked if the value is yes. <?php $query = "SELECT * FROM pcustomers WHERE id = $id"; $result=mysql_db_query($dbName,$query); $row = mysql_fetch_array($result); mysql_free_result($result); ?> <input type="checkbox" name="terms" value="<?php echo $row["frontpage"] ?>"> <input type="checkbox" name="terms" value="<?php echo $row["terms"] ?>"> <input type="checkbox" name="wantdatabase" value="<?php echo $row["wantdatabase"] ?>">

« previous php.general (#27170) next »