Welcome! Log In Create A New Profile

Advanced

confused smiley Movie database (Chapter 3 in Beginning PHP5)

Posted by rharris 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
confused smiley Movie database (Chapter 3 in Beginning PHP5)
September 08, 2008 03:56PM
Good day

I`m busy with a Select.phpconfused smiley script on the Movie database

this is my script

<?php
//connect to MySQL
$connect = mysql_connect ("localhost","ryan","ryan"winking smiley or
die ("Hey loser, check your server connection."winking smiley;
//make sure we`re using the right database
mysql_select_db ("moviesite"winking smiley;

$query = "SELECT movie_name,movie_type".
"FROM movie".
"WHERE movie_year>1990 ".
"ORDER BY movie_type ";
$results = mysql_query ($query)
or die (mysql_error());
while ($row = mysql_fetch_array ($results)) {
extract ($row);
echo $movie_name;
echo "-";
echo $movie_type;
echo "<br>";
}
?>

And this is the result I get when running it

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 'movie_year>1990 ORDER BY movie_type' at line 1

Please help !!

Thanks

Ryan Harris
avatar
Mac
confused smiley Re: Movie database (Chapter 3 in Beginning PHP5)
September 09, 2008 06:45AM
well, you have an error in your SQL syntax
near 'movie_year>1990 ORDER BY movie_type' smiling smiley

'1990'
Sorry, only registered users may post in this forum.

Click here to login