I Have a problem with syntax error on the following code
$myregion = $_POST['region'];echo $myregion;$names = mysql_query("SELECT * FROM course_name WHERE Region=$myregion"); while($row = mysql_fetch_array($names)) {echo $row['Name_of_Course'], " " , $row['Region'], " " , $row['Price'],"<br>";}$myregion = $_POST['region'];
echo $myregion;
$names = mysql_query("SELECT * FROM course_name WHERE Region=$myregion");
while($row = mysql_fetch_array($names)) {
echo $row['Name_of_Course'], " " , $row['Region'], " " , $row['Price'],"<br>";
}
error is fetch_array expectects parameter 1 to be resource, boolean given on line 47
This code worked fine if I hard coded the Where condition but once I have put the $variable in, i get the error?
Could nyone help as I am new to php mysql