I am very new to php and am slowly trying to get something together.
I have a MySQL database with a table that has (among others) a field which is TINYINT called "field1". I have managed to be able to store a 1 or 0 in it from a checkbox.
I now need to be able to display that choice as a checkbox after it has been stored in the database.
The code I have:
<?php /* some php code */ /* Name */ echo "<p><b>Name: ".$req_user_info['name']."</b><br />"; /* Username */ echo "<p><b>Username: ".$req_user_info['username']."</b><br />"; /* Email */ echo "<b>Email:</b> ".$req_user_info['email']."</p>"; /* field1 */ echo "<b>field1:</b> ".$req_user_info['field1']."</p>"; /* some more php code */ ?>
Name: Steven King
This shows me that the value is being retrieved correctly, but instead of text of numeral 1 or 0, I want it to display a checkbox that is either checked(1) or not checked(0).
I have found so much help on how to get checkbox values into a MySQL database, but none on how to display retrieved values as a checkbox.
Any help that anyone could offer would be greatly appreciated.