Small syntax problems & lt ;? Php $ dbmysql_connect (localhost, bp6am, 123) & nbsp; ordie (Unabletoconnect.); $ queryCREATEDATABASEIFNOTEXISTSmoviesite; mysql_query ($ query, $ db) ordie (mys small syntax problem
$ Db = mysql_connect ('localhost', 'bp6am', '123 ')
Or die ('unable to connect .');
$ Query = 'create database if not exists moviesite ';
Mysql_query ($ query, $ db) or die (mysql_error ($ db ));
Mysql_select_db ('moviesite ', $ db) or die (mysql_error ($ db ));
$ Query = 'create TABLE movie (
Movie_id integer unsigned not null AUTO_INCREMENT,
Movie_name VARCHAR (255) not null,
Movie_type tinyint not null default 0,
Movie_year smallint unsigned not null default 0,
Primary key (movie_id ),
KEY movie_type (movie_type, movie_year)
)';
Mysql_query ($ query, $ db) or die (mysql_error ($ db ));
?>
Then, when running the command, 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 ';)' at line 7
------ Solution --------------------
Syntax error, look at your SQL statement