You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
After writing the two scripts and ran the first one.. I got an error stating that bp6am access denied to moviesite. I've got pass that by adding CREATE while granting privileges to bp6am under the root admin.
mysql.exe -u root -p test
password: ********** (whatever pw you entered back in ch1)
GRANT CREATE, SELECT, INSERT, UPDATE ON *.*
IDENTIFIED BY "bp6ampass";
But now that I ran after making that correction, I get the following error:
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_name VARCHAR(255) NOT NULL, ' at line 2
The code is this:
//create the movie table
$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,
movie_leadactor INTEGER UNSIGNED NOT NULL DEFAULT 0,
movie_director INTEGER 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));
Did I missed something here? your input will be greatly appreciated.
When coding, I use notepad2, but that's just me...