I've been struggling with this from yesterday. I'm trying to do an if statement in an echo, I've followed this post (if block inside echo statement?) but my if statement does not evaluate to true. I've even put in the values for $quenr1 & $anscho1 but no sucess. Please help. Please reply if you need all the code.
$quenr1 = 1;
$anscho1 = 'A';
if ($q_type != 'mr')
{
if($option1!="")
{
echo "<input type='radio' name='$quenr1' value='A'" . ($anscho1 == A ? 'checked="checked"' : '') . ">$quenr1<br />";
}
}
EDITED
Thanks for all the replies, you've put me in the right direction. As a last resort I removed all my code and started from scratch and just put in the query to retrieve the data and display the form and it worked fine.