I keep getting this error when I try to run and print out the results of my database query. I know that this error usually mean that my query failed but i can't figure out what is wrong with it.
$genre=readline("Enter Genre: ");
$query = "SELECT movie_title FROM movie WHERE movie_genre = $genre";
$result = $db_obj->query("$query");
while($row = mysql_fetch_array($result)){
echo $row['movie_title']. " - ". $row['movie_genre'];
echo "\n";
}
I've even tried just using "SELECT movie_title FROM movie" to see if it would work without the variable but it still gave me the same error.