p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 (http://p2p.wrox.com/forumdisplay.php?f=160)
-   -   Chapter 3 Page 95 (http://p2p.wrox.com/showthread.php?t=65110)

jumpot89 January 8th, 2008 12:00 PM

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


can assassin August 4th, 2008 09:15 PM

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


Old Pedant August 4th, 2008 09:44 PM

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.

can assassin August 5th, 2008 01:05 AM

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.


can assassin August 5th, 2008 04:23 PM

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.


sandeepgreaternoida April 12th, 2009 05:25 PM

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
[:(!]

ecdoesit April 22nd, 2009 03:11 AM

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.


All times are GMT -4. The time now is 09:31 AM.

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