 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 31st, 2004, 04:57 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chp 3 96-98 syntax error: ') TYPE=MYISAM
oh boy...
I have gone through this code with a fine tooth comb...and here is the error I am generating now:
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 ') TYPE=MyISAM AUTO_INCREMENT=7' at line 7
the applicable code follows:
mysql_select_db ("wiley");
//create 'movie" table
$movie = "CREATE TABLE movie (
movie_id int(11) NOT NULL auto_increment,
movie_name varchar(255) NOT NULL,
movie_type tinyint(2) NOT NULL default 0,
movie_year int(4) NOT NULL default 0,
movie_leadactor int(11) NOT NULL default 0,
movie_director int(11) NOT NULL default 0,
PRIMARY KEY (movie_id),
KEY movie_type (movie_type,movie_year)
) TYPE=MyISAM AUTO_INCREMENT=4 ";
$results = mysql_query($movie)
or die (mysql_error());
//create "movietype" table
$movietype = "CREATE TABLE movietype (
movietype_id int(11) NOT NULL auto_increment,
movietype_label varchar(100) NOT NULL,
PRIMARY KEY (movietype_id)
) TYPE=MyISAM AUTO_INCREMENT=9" ;
$results = mysql_query($movietype)
or die(mysql_error());
//create "people" table
$people = "CREATE TABLE people (
people_id int(11) NOT NULL auto_increment,
people_fullname varchar(255) NOT NULL,
people_isactor tinyint(1) NOT NULL default 0,
people_isdirector tinyint(1) NOT NULL default 0,
PRIMARY KEY (people_id)
) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people)
or die (mysql_error());
echo "Movie Database successfully created";
?>
I have gone over what the book says, and what I have entered is exactly as presented by the book, so why the error? If it processed through the movie and movie_type tables, why get hung up at this juncture?
Again, thanks in advance,
Steve
|
|

September 12th, 2004, 08:56 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have the same error from the createreviews.php code. I am using mysql 4.0.20
|
|

September 14th, 2004, 03:44 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Wildroosta,
I am also using 4.0.20. As you can see from this post, I have been waiting for someone...perhaps one of the mods or authors(hint-hint)...to post a solution. I am glad that I am not the only person to be suffering from this problem. I have literally tried everything, and feel like I can't go any further 'til I resolve this issue. I am a little peeved to say the least.
Steve
|
|

December 8th, 2004, 01:34 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had this same problem, and I finally realized that I was adding an extra comma at the end of the line just above it (which you should not, because it's the last line of the variable inside the parenthesis). Now your code that you've posted does not show a comma, but that's what my problem was. Perhaps it's yours too.
|
|

December 9th, 2004, 01:34 AM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Had the same problem. In comparing your code I didn't see any difference from mine but I did notice that I had changed the following based on a posting in this forum.
//create the main database
//mysql_create_db("wiley")
// or die(mysql_error());
$query = mysql_query("CREATE DATABASE wiley")
or die(mysql_error());
If you haven't already changed that you might try it. I've had so many problems that I can't remember exactly what I did to correct this one.
Ron
|
|

December 18th, 2004, 05:47 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bodenzord is right. The comma needs to be removed from the end of the line:
KEY (review_movie_id),
If you remove the comma everything should be peachy.
NB: This is just one of the many typos I have seen in this book. While most of them are easily solvable, it is very annoying to have to spend additional time fixing them. For that reason this will probably be the first and last WROX book I purchase.
|
|

January 29th, 2005, 10:02 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Not to get off on a rant here, however... I also struggled with this error (as well as several others) for quite a while.
I bought this book late last year and have found a HEAP of typos and just plain wrong code both in the book and from the downloadable code section of this site. I have posted corrections to the "errata" section of the Wrox site over the past couple of days, and this error is one that I also submitted.
It is very frustrating and extremely time-consuming to debug the book/download code while trying to learn a new coding language. Consequently, I've chucked the book aside in a fit of frustration many times!
You'd think that the editors at Wrox would understand that errant commas, missing semi-colons, out-of-sequence sections, etc. are kind of important little things for programming.
I've got to agree with 'cupcakeboy', if this book represents the quality of editing/final QA that Wrox books offers, this will be the last one I buy.
Very disappointed.
|
|

January 29th, 2006, 05:28 PM
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
bodenzord, thanks I thought I was going mad, I copied the code and typed it in and was getting
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 ') TYPE=MyISAM' at line 9
thanks
its not the first problem I have had and sounds like it will not be my last problem
|
|
 |