Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 September 4th, 2004, 12:43 PM
nav nav is offline
Registered User
 
Join Date: Aug 2004
Location: halsowen, , United Kingdom.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using PHP with MySQL

I am working through Beginning PHP, Apache, MySQL Web Development. I am on chapter 3 'using php with mysql'.

I have typed up the code as in the book into note pad. The book says to save the file as 'createmovie.php' which i done. I then typed up the code as in the book to enter data into the tables just created. I saved this file as 'moviedata.php'.

It then says to run the createmovie.php file in the browser which i done. All i saw was the code i just type up. Is this right?

It then says to run the moviedata.php file. When i do this i don't get a success message instead i get "Duplicate entry '1' for key 1".
what does this mean?

I really don't know whether or not my database has been created. I have checked the code and it looks okay.

Can somebody please help this is driving me crazy

Please


Reply With Quote
  #2 (permalink)  
Old September 5th, 2004, 04:02 AM
Authorized User
 
Join Date: Jul 2004
Location: rajshahi, , Bangladesh.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru
Default

Your question is also ambigous to me.
there are several option i can callup now for you

1. You must run php on server. First, copy your php file to a subfolder under webserver root. then type address of that file from your browser. To get right result your server must know how to handle php file. I think your webserver is not configured for executing php files. If you don't configure your webserver then you will get code that you wrote before as result. So first configure your webserver. I think how to configure webserver, you will get in the book details.
Or,
2. I think you have configured your webserver for php files as you get this message "Duplicate entry '1' for key 1". You get the whole code that you typed as result when you run 'createmovie.php' because you may not php code block with php tag <?php ....... ?>.
3. U have successfully executed php code and a database has been created and it has 1 table and at least one row of data. You are trying to insert duplicate data, that's why you get that message.

If these solution is not clear to you, you may chat with me. zhraju2003@yahoo.com, rajuru@hotmail.com


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
PHP-MySql imhappy Beginning PHP 1 September 24th, 2008 05:44 AM
PHP and MySQL MiNdWaRp PHP How-To 0 May 14th, 2007 06:25 PM
MySQL/PHP Help blackout Beginning PHP 1 August 8th, 2006 07:49 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 09:57 AM
MySQL/PHP Gyhth PHP Databases 3 May 27th, 2005 08:21 PM



All times are GMT -4. The time now is 01:14 PM.


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