I'm new to web applications, I was trying to write this simple query
$query2 = "SELECT * from sections WHERE starting = ' 8:00 ' And day = ' Monday ' AND section = '$section' AND campus = '$campus' AND year = '$year' ";
$result = mysql_query($query2) or die(mysql_error($conn));
$count2 = mysql_num_rows($result);
if($count2==0){
echo'<td color=orange> </td>';
}
while ($row = mysqli_fetch_array($result)) {
echo "<td>".$row['course']."</td>";}
However I'm getting this error. I tried to figure it out but I couldn't. Could someone plz help me
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'And day = ' Monday ' AND section = 'A' AND campus = 'Nabatieh' AND year = 'Bache' at line 1