Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 31st, 2004, 05:57 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old September 12th, 2004, 09:56 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same error from the createreviews.php code. I am using mysql 4.0.20

Reply With Quote
  #3 (permalink)  
Old September 14th, 2004, 04:44 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old December 8th, 2004, 01:34 AM
Authorized User
 
Join Date: Dec 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Reply With Quote
  #5 (permalink)  
Old December 9th, 2004, 01:34 AM
rah rah is offline
Registered User
 
Join Date: Dec 2004
Location: Angelus Oaks, CA, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #6 (permalink)  
Old December 18th, 2004, 05:47 PM
Registered User
 
Join Date: Dec 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #7 (permalink)  
Old January 29th, 2005, 10:02 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #8 (permalink)  
Old January 29th, 2006, 05:28 PM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
register.php in CHP 01 --> uid error obitori BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 1 April 2nd, 2009 01:47 PM
MySQL Fatal Error Chap 3, Pg 96-96 joshkosmala BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 January 8th, 2007 01:55 PM
MYISAM or InnoDB? lanita BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 July 20th, 2004 10:40 AM
"70 Permission Denied" error in Windows 98 benoyraj VB How-To 0 May 3rd, 2004 01:53 PM



All times are GMT -4. The time now is 04:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.