POST boolean values using php IF statement
<p>I'd like to show the user what choices they made as feedback to a search query. </p>

<p>The data is a boolean stored as a tinyint in my database;</p>

<pre><code>mysql&gt; tablename;
+---------+-------------+------+-----+---------+-------+
| Field   | Type        | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| hdk_1   | TINYINT(1)  | YES  |     | NULL    |       |
+---------+-------------+------+-----+---------+-------+
| hdk_2   | TINYINT(1)  | YES  |     | NULL    |       |
+---------+-------------+------+-----+---------+-------+
| hdk_3   | TINYINT(1)  | YES  |     | NULL    |       |
+---------+-------------+------+-----+---------+-------+
</code></pre>

<p>My limited thinking is to echo this as an IF statement like;</p>

<pre><code>&lt;?php
$hdk_1=$_POST['hdk_1'];
$hdk_2=$_POST['hdk_2'];
$hdk_3=$_POST['hdk_3'];

if (isset ($hdk_1)) 
{
echo '&lt;h4&gt;Hardiker Level: &lt;span&gt;'.$hdk_1.'&lt;/span&gt;&lt;/h4&gt;';
}
else
{
echo '&lt;h4&gt;Hardiker Level: &lt;span&gt;'.$hdk_2.'&lt;/span&gt;&lt;/h4&gt;';
}
    else
{
echo '&lt;h4&gt;Hardiker Level: &lt;span&gt;'.$hdk_3.'&lt;/span&gt;&lt;/h4&gt;';
}
</code></pre>

<p>I want to do this as orginally I had a varchar yet want to chage this for validation reasons...</p>

<pre><code>if (isset ($hardiker))
{
echo '&lt;h4 class="fs"&gt;Hardiker: &lt;span style="color: #000; font-weight:bold"&gt;'.$hardiker.'&lt;/span&gt;&lt;/h4&gt;';
}
else
{
echo '&lt;h4 class="fs"&gt;You have searched all hardiker levels.&lt;/h4&gt;';}
</code></pre>
