I have a form that uses a radio button, this button decides if it shows a piece of data or not:
<input type="radio" name="IncludeData" value="1" />Yes
<input type="radio" name="IncludeData" value="0" />No
Yes = 1 and No = 0.
I'm then using this query to call the data:
$IncludeData = $_POST['IncludeData'];
$sql = "SELECT data1, data2, data3, IF($IncludeData='0',Null,data4), data4, data5 FROM Database ORDER BY data1 asc";
I've tried following the answer from this question: MYSQL hide field data if value in another field is set.
However, it always seems to keep the data no matter what I select on the radio button. Any help would be greatly appreciated.
This is where I grab the data from:
<td>
Sort table on =
<select name="Sort">
<option value="data1" selected="selected">Example1</option>
<option value="data2">Example2</option>
<option value="data3">Example3</option>
<option value="data4">Example4</option>
<option value="data5">Example5</option>
</select>
</td>