Can someone help me with a problem using select query.
When running the script to select information from the database the message I receive is:
Unknown column 'movie.name' in 'field list'
I have checked in mysql console on wamp server and the field is showing in the moviesite table so it does exist. Then I dropped the database, checked the syntax again and re-saved the script. Then I re-started wamp server again in case this was needed. I created again plus inserted the data all successfully. However the error message was still being returned so I am confused as to how the field is not being recognised?
Here is the code used but can't see any real problems with it:
<?php
//connect to MySQL
$db = mysql_connect ('localhost', 'root', '') or
die ('Unable to connect. Check your connection parameters.');
//make sure our recently created datbase is the active one
mysql_select_db('moviesite', $db) or die(mysql_error($db));
//select the movie titles and their genre after the year 1990
$query = 'SELECT
movie.name, movie_type
FROM
movie
WHERE
movie_year > 1990
ORDER BY
movie_type';
$result = mysql_query($query, $db) or die(mysql_error($db));
//show the results
while ($row = mysql_fetch_array($result)) {
extract($row);
echo $movie_name . ' - ' . $movie_type . '<br/>';
}
?>
Any pointers on this would be greatly appreciated.
