how can i restrict that if there is the status of image is 1 in the database, show the picture in the php form, else no.
<br>
require ("connection.php");
$r="";
$i=1;
echo "<form method='post' action='question1.php'>";
echo "<center>Questionnaire 1<br>Total Questions 10 in Page 1</center>";

$s="select * from qbank_dump where uname='".$_SESSION['user']."' and sno<=10 order by sno asc";
$q=mysql_query($s) or die(mysql_error());
while($r=mysql_fetch_array($q))
{
echo "<div style='margin-left:100px; margin-top:20px;'>";
echo "&nbsp;Q:&nbsp;".$r[0]." .&nbsp; ".$r[3]."<br>";

$s="select * from qbank_dump where uname='".$_SESSION['user']."' and sno<=10 order by sno asc";
$q=mysql_query($s) or die(mysql_error());
if($r[9] == 1 )
{
echo "<img src='upload_image/".$r[9]."' width=400>";
}
echo "<table><tr><td>Ans:</td></tr><tr><td> A)</td><td><input type='radio' name='r1[$i]' value='$r[4]' ></td><td>".$r[4]."</td></tr><tr><td>B)</td><td><input type='radio' name='r1[$i]' value='$r[5]'></td><td>".$r[5]."</td></tr><tr><td>C)</td><td><input type='radio' name='r1[$i]' value='$r[6]'></td><td>".$r[6]."</td></tr><tr><td>D)</td><td><input type='radio' name='r1[$i]' value='$r[7]'></td><td>".$r[7]."</td></tr></table></div><br><input type=hidden name='ans[$i]' value='".$r[8]."' > <input type=hidden name='q1[$i]' value='".$r[1]."'>";
$i++;
}

?>
<center>
<input type="submit" value="S U B M I T" name="sbt1" style="background-image:url(image/29.jpg); height:50px; width:200px; color:#FFFFFF; font-weight:bold;" />
<br /><br />
Click here to end this test...<input type="submit" value="Finish Online Test" name="sbt2" style="background-color:#CC00FF; color:#FFFFFF; font-weight:bold;" /></form>
<br />
1&nbsp;&nbsp;||&nbsp;Next Page>>>&nbsp;&nbsp;<a href="question2.php">2</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="question3.php">3</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">4</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">5</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">6</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">7</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">8</a>&nbsp;&nbsp;||&nbsp;&nbsp;<a href="#">9</a>&nbsp;&nbsp;||&nbsp;<a href="#">10</a>
</center>

</body>
</html>