Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 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 Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2005, 01:43 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems in Ch3 and Ch4

Hello,

something is wrong in chapter 3 since even when I used the downloaded
code(s) I still got the same problem.

on pages 94 and 95 we create the file (createmovie.php) then we create
(moviedata.php) and within this last file we are connecting to the database (moviesite) although I think we should be connecting to the one that we have just created (createmovie.php).

When I run (createmovie) or the (moviesite) I get the following message:
(Table Movie already exists)

and when I run the moviedata I get the following:
Duplicate entry '1' for key 1

EVEN WHEN I USED the downloaded codes!

this seems is effecting me in chapter 4:

in the examples table1 and table2

I'm getting the following:
(
Unknown column 'movie_name' in 'field list'
)

I'm really feeling stuck here since all the coming examples in this
toutorial depends on each other.

So does any body has any idea what is going on here?

Thanx

Maram:(

Reply With Quote
  #2 (permalink)  
Old June 16th, 2005, 03:50 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It sounds like you're trying to create the movie databases/tables, when they already exist in MySQL. Either don't try to recreate them, or drop them and start over.

Reply With Quote
  #3 (permalink)  
Old August 4th, 2005, 09:28 AM
Authorized User
 
Join Date: Aug 2005
Location: , , Canada.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Change you createmovie.php file create table statement to

$movie = CREATE TABLE IF NOT EXISTS movie( etc...
then if the table already exists you done get a die error.

The name of the database created by running createmovie.php is "moviesite"

In the moviedata.php file the tables are populated the first time each segment is completed without error. The next time you run the file your are trying tp populate with data that has the same primary key id. Since these keys have to be unique you can't have another record with the same id.

This is the point I am at in doing the examples so I don't yet know how to handle this type of error. I suppose you should just ignore the error and not insert the record and continue execution of remaining code.

Hope this helps.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
VB: Ch4 p123 How It Works (Personalisation) Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 October 19th, 2007 07:23 AM
VB: Ch4 p132 Security Try It Out Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 19th, 2007 05:05 AM
Ch4 Problem daivos03 JSP Basics 9 January 30th, 2006 01:57 AM
ch4 wrong output? pete12345 JSP Basics 3 January 24th, 2004 09:51 AM



All times are GMT -4. The time now is 12:50 PM.


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