Wrox Programmer Forums
|
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
 
Old March 25th, 2004, 08:34 AM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default createmovie.php

Ive run through the early chapters of this book and hit a snag on chapter three (where you begin integrating php and mysql).
I've typed out the createmovie.php which attempts to construc the movie database, but when I run the php file in my browser it just sits there "sending request to localhost". All the other php files in the DIR run without a problem, but this just sits there indefinitely!

I've downloaded the code from the wrox site to ensure it wasn't a typo of mine causing the problem but that hasn't changed anything. If I stop the mysql service in windows then I get the expected "cannot connect to server" error message, but when its running the page just tries to load indefinitely!

What am I doing wrong?

Thanks :)


 
Old April 12th, 2004, 09:06 PM
Authorized User
 
Join Date: Apr 2004
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I assume you changed the connection variables to match those on your server... what versions of PHP and MySQL are you running?

 
Old April 25th, 2004, 02:33 AM
Registered User
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using PHP 4.3.6, Apache 2.0.49, and MySQL 4.0.18 on Windows XP SP-1. I copied the code from the web site. Everything has worked fine up until now. When I try to go to http://localhost/createmovie.php it goes nowhere fast. It acts like it is going to connect until I stop it. Is the code wrong? I know I am connecting to MySQL, because when I feed it an incorrect password, it gives me this:

Warning: mysql_connect(): Access denied for user: 'root@localhost' (Using password: YES) in C:\Program Files\Apache Group\Apache2\test\createmovie.php on line 4
Hey loser, check your server connection.

And when trying to connect to "moviedata.php" it says this:

Table 'wiley.movie' doesn't exist

...obviously. Which brings us back to the original problem: Why is "createmovie.php" sitting there acting like drying paint but with less enthusiasm?

 
Old April 25th, 2004, 01:08 PM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cpkaiser
Default

I am encountering the exact same problem. I've checked and double checked can't find the cause....

Any suggestions would be greatly appreciated.

-Chris
 
Old April 25th, 2004, 04:47 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Ok, I don't have the book, and many of us answering questions don't. I would venture a guess from this error:

Table 'wiley.movie' doesn't exist

that one of the required database tables 'movie' hasn't been loaded into the database 'wiley'. Verify that this table exists in that database and contains the required data, perhaps there is an SQL file you're supposed to load into MySQL with the script?

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old April 25th, 2004, 06:12 PM
Registered User
 
Join Date: Apr 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cpkaiser
Default

I got it working. not sure of the problem but here is what I did.
I went into the mysql data directory(c:\mysql\data)and seen that the folder for the db had been created but contained nothing. I deleted that folder and then re-run the script. Everything worked that time. Don't really understand why though....

-Chris

-Chris
 
Old April 26th, 2004, 01:36 AM
Registered User
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Chris,

THANK YOU! Deleting the existing "wiley" folder worked like a charm. I have no idea why that worked either, but software is funny like that. I did take a peek at my .err log and I have numerous entries like this:

040425 19:01:52 InnoDB: Started
MySQL: ready for connections.
Version: '4.0.18-max-debug-log' socket: '' port: 3306
040425 19:19:57 MySQL: Normal shutdown

040425 19:00:29 InnoDB: Starting shutdown...
040425 19:00:31 InnoDB: Shutdown completed
040425 19:00:31 MySQL: Shutdown Complete

Numerous because I kept trying to get the *&^$ thing to work. I'm totally new to AMP, so I didn't even think of looking in the MySQL directories. Beautiful. On with the show!

 
Old April 26th, 2004, 02:02 AM
Registered User
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now that I started thinking about it, the errors are very weird. They say InnoDB, but in our script we specified MyISAM. No references to InnoDB anywhere.

So, the plot thickens... Could that be the problem? Part of the problem? Maybe aiding and abetting the problem? I'd put money on it. Experts?

 
Old April 26th, 2004, 02:02 AM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, it seems to hang on the create_db bit if the database already exists!!!!!!!!
Why it doesn't give an error message (and why the code doesn't check it exists first) I dont know...stupid bloody code! :(

 
Old April 26th, 2004, 02:15 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Glad to hear you have it figured out!

Quote:
quote:
Everything worked that time. Don't really understand why though....
Well its like I said, if the table doesn't exist the script won't be able to pull data from it ;). The db directory not containing any files for tables is also an indication of that, as you figured out, a more thorough check is to have a look at the data from the command line or a frontend tool like phpMyAdmin (A web-based MySQL administration package). You'd do this by making a simple query, if using the mysql command line located at C:\mysql\bin\mysql.exe, type in:

Code:
mysql> connect wiley
mysql> SELECT * FROM `movie`;
If MySQL returns an error saying the table doesn't exist, then something went wrong with the SQL you used to create the table, although you should have seen some errors at that point. Not that just looking for the files is a bad thing, but if the table exists but doesn't contain data you'd still be lost.

Although in the beginning such things aren't always so easy to discover, but none-the-less, are still valuable experiences in that, you have that much more experience debugging an application under your belt. As far as how the script is set-up, without seeing some code most of us aren't going to be able to comment on that side of it or offer theories or explainations of why the script failed to run the first time! Having already learned PHP, personally, I don't bother buying the books anymore :).

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM
potential createmovie.php error ElizabethN BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 8 August 25th, 2004 09:46 AM
createmovie.php logon trouble JohnAlden BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 May 25th, 2004 01:11 PM
Error troubleshooting - createmovie.php samgman BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 May 13th, 2004 01:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.