Can anybody help me to check what's wrong with the coding. First, i get the value of checkbox from the previous page. So, if checkbox 1 and 2 is selected, result with result_id 4 will be shown. if checkbox 1 and 3 is selected, result with result_id 5 will be shown. Now the problem is...no matter which checkbox is selected, the program will only run 'if statement' , which is result_id 4. Below is the coding. Hope you guys can help me. >< .Thank alot!! <?php session_start(); if(isset($_GET['checkbox'])){ $checkbox = $_GET['checkbox']; } else { header('Location:tutorial.php'); } include("database.php"); for($i=0; $i < count($checkbox); $i++){ { if ($checkbox[$i]= '1' && $checkbox[$i]= '2'){ $sql="SELECT * FROM result WHERE result.result_id = 4";} elseif ($checkbox[$i]='1' && $checkbox[$i]= '3'){ $sql="SELECT * FROM result WHERE result.result_id = 5";} else {} } } $result=mysql_query($sql); echo "<form action = 'result.php' method='POST'> <br/>"; echo "<table>"; while($row = mysql_fetch_array($result)) { $result_name=$row['result_name']; $result_id=$row['result_id']; $result_desc=$row['result_desc']; $image=$row['image']; echo "<h4>$result_name</h4> "; echo "<tr >"; echo "<td>"; echo "</form>";?> <img src="<?php echo $row ["image"];?>" width="500" height = "600" align="left" border="1" /><?php echo "</td>" ; echo "</tr>"; } echo "</table>"; ?>