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 January 8th, 2008, 12:00 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 Page 95

Hi Guy !!! I new on PHP Programer

           I have a little bit problem about the files Moviedata on page 95. I can't find what the wrong code for this one when I tried to run this moviedata.php, it shows up like this "Duplicate entry '1' for key 1"

I use many way but I didn't understand what the meaning of Duplicate entry '1' for key 1 would you help me to solve this problem

Thank you all

Reply With Quote
  #2 (permalink)  
Old August 4th, 2008, 09:15 PM
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem and no matter what i did i couldnt find the problem, even after going over it letter by letter.

If you just use the downloadable code and paste it in it seems to be fixed. So just download their code and use it.

But now i have a new problem, after that was fixed, it always goes like this:
Code:
Table 'moviesite.movietype' doesn't exist
I have no idea what is wrong, is it something in my php file???
Please help

thanks in advance

can assassin

Reply With Quote
  #3 (permalink)  
Old August 4th, 2008, 09:44 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

That's not a PHP error. It's a mySQL error.

If "moviesite" is supposed to be the name of a database, then it's saying that either:
(1) the moviesite database doesn't exist or
(2) the table named "movietype" in that database doesn't exist.

MySQL is case sensitive when running on any OS except Windows, so the table name *MUST* be spelled exactly correctly, upper and lower case.

If "moviesite" is supposed to be the name of a table, then it's saying that the table named "moviesite" doesn't exist.

Look in the MySQL DB to figure out what reality is as opposed to what the PHP code thinks it is.

Oh...and don't respond to posts that are months and months and even years old. Start your own new thread. The person you answered has posted exactly *ONE* message in these forums (the one you answered) so it would be a near mirable if he ever sees your reply.
Reply With Quote
  #4 (permalink)  
Old August 5th, 2008, 01:05 AM
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried copying the actual code from the zip file and it didnt work. And also, im running it on windows XP. Nothing appears wrong with the mysql db but il keep looking.

Thanks for the quick reply.

Reply With Quote
  #5 (permalink)  
Old August 5th, 2008, 04:23 PM
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alright, problem solved sort of.

I have no idea what the problem was. I just started my computer this morning, tried it again and it worked. I am clueless, nothing is any different then yesterday.

Thanks for the help.

Reply With Quote
  #6 (permalink)  
Old April 12th, 2009, 05:25 PM
Authorized User
 
Join Date: Dec 2007
Location: greaternoida, u.p, India.
Posts: 65
Thanks: 9
Thanked 2 Times in 2 Posts
Send a message via AIM to sandeepgreaternoida Send a message via MSN to sandeepgreaternoida Send a message via Yahoo to sandeepgreaternoida
Thumbs down i am in createmovie and moviedata trap

Hi, i m very much frustrated;the file > createmovie.php and moviedata.php is not working.
Although other php files are working fine on my apache server.
i have apache2.2, php5.2 and mysql5 installed on window xp sp-3

i do not know what's the problem is going on, i download the code and use them (createmovie.php and moviedata.php) directly by just changing the password on both files. My password is working absolutely fine on MySqlCommandLineClient.


pls. help me
__________________
sandeep gupta
Reply With Quote
  #7 (permalink)  
Old April 22nd, 2009, 03:11 AM
Registered User
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same exact problem and was able to fix it by using phpmyadmin
to look at the database "moviesite".

Use phpmyadmin and find the "moviesite" database. Browse that database and you should have three tables named movie, movietype, and people. Check all of them and empty those tables.

Now run the moviedata.php file again and it should attempt to fill in the tables again but this time with a clean slate.


I think the problem was that when I first ran moviedata.php I had errors in it that needed to be fixed. But, before that type or error in the file, the moviedata.php file ran and populated some of the tables. When I fixed the typo and went to run the moviedata.php file again, it tried to populate tables that already had fields filled in.

Hopefully clearing out the tables in the database before running moviedata.php should help.

I'm a beginner to all this, so any experts let me know if I'm accurately solving this issue.
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
Pass 1z0-042 With 95% ucham VBScript 1 July 25th, 2013 08:45 AM
Chapter 3 page 95 nead23 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 March 26th, 2009 09:28 AM
Chapter 3 pg 95 al2000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 August 4th, 2008 09:18 PM
Chapter 3, page 95 Swerve1000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 May 29th, 2007 04:45 PM
It wont Connect toMySQLChapter 3,Page 95-98, Alej PHP Databases 3 August 29th, 2006 11:37 PM



All times are GMT -4. The time now is 12:49 AM.


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