adam291086 Posted December 9, 2007 Share Posted December 9, 2007 Heres the problem. I have a database query returning some result. These results need to be represented in the form of a check box. Is this possible? If so how? For example, if the result is ==Home tick the box else leave it blank. Link to comment https://forums.phpfreaks.com/topic/80917-solved-check-box-ticked-if-database-result-is-present/ Share on other sites More sharing options...
pocobueno1388 Posted December 9, 2007 Share Posted December 9, 2007 You could do this <?php if ($row['col'] == 'home') $checked = "checked='yes'"; else $checked = ""; echo "<input type='checkbox' name='name' value='val' $checked>"; ?> Link to comment https://forums.phpfreaks.com/topic/80917-solved-check-box-ticked-if-database-result-is-present/#findComment-410505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.