Hi All
I have creating a database table that will store configuration values so that php knows whether to show a field within a html form or not.
I know that the PHP code connects to the table within the database as there are now errors when the webpage is loaded.
Each field stores only one item of data. The first field called 'fieldname' stores the name of the field I want to set a value for. The second field called 'value' stores a boolean value that indicates if the html form field should be shown.
The variable $field
collects the mysql query result. However $field
always seems to be 0 and doesn't seem to read 'value'(set to 1) in the database.
Am I being dense?! lol
if(!$DBC)
{
die("not connected" . mysql_error());
}
$DB = mysql_select_db("table",$DBC);
if(!$DB)
{
die("error" . mysql_error());
}
$field = mysql_query("select value from Table where fieldname = 'fullname'");
if($field == 1)
{
echo("showing fullname field ");
echo("<td>Your full name<br/>");
}else
echo("Not showing fullname field ";
?>