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 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 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 August 13th, 2004, 06:28 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default connecting to mysql using Php

Sorry folks, but I just can't get round this one and need some help. I'm stuck at chapter 3 with the createmovie.php, whenever I use

http://localhost/createmovie.php

I get the following message

Fatal error: Call to undefined function mysql_connect()

Any ideas where in my mysql setup or php setup I must have gone wrong? I've currently reinstalled several times (hitting most of the install problems mentioned on this forum), but can't seem to see this one. I've tried just using the code supplied by wrox on the assumption I've speeled things wrong, but alas no avail.

Thanks in advance

Reply With Quote
  #2 (permalink)  
Old August 13th, 2004, 10:00 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you please post the exact code of tha page is giving you problem.

Christian

Reply With Quote
  #3 (permalink)  
Old August 13th, 2004, 10:55 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I believe the problem lies in the setup of PHP rather than the code.

Snib

<><
Reply With Quote
  #4 (permalink)  
Old August 13th, 2004, 03:31 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

It sounds like you're using PHP 5, MySQL functionality is not included in PHP 5 by default, but it is included in PHP 4 by default. So you have a few options, you could go back to PHP 4, which was what the book was written with. Or you could go through the process of installing the mysql extension with PHP 5 (PHP version shouldn't matter as far as the book is concerned).

AFAIK, all you have to do is uncomment the extension .dll in php.ini and make sure that the extension path is correct and the extension exists in that directory.

So step by step, open php.ini typically located at C:\Windows\php.ini.

Provide the correct path to the extension directory.
Code:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
I recommend C:\PHP\extensions.

Uncomment the extension by removing the semi-colon.
Code:
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
Save php.ini.

These extra extensions are typically available in the .zip download of PHP but not the Windows installer.

Finally you need to copy libmysql.dll from the PHP directory to the Windows directory, e.g. C:\Windows.

Restart Apache, MySQL ought to work now.


Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #5 (permalink)  
Old August 16th, 2004, 04:10 AM
Authorized User
 
Join Date: Jul 2004
Location: Las Vegas, NV, USA.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by richard.york
 Finally you need to copy libmysql.dll from the PHP directory to the Windows directory, e.g. C:\Windows.
That would work on a NON-NT machine. NT machines are Win2k, WinXP. If you are on Win95/8 or WinME then Windows is probably the place.

On a an NT based box, you can easily check from a commnad line.

C:\> echo %systemroot%

That will give you the exact location

Reply With Quote
  #6 (permalink)  
Old August 22nd, 2004, 04:39 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I had the same problem w/ webmoron... I it copied already the libmysql.dll even libmysqli.dll but the error persists still... and in phpinfo, there is no mysql information..
Thanx

Reply With Quote
  #7 (permalink)  
Old August 24th, 2004, 04:30 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the replies, apologies for the delay in replying. Have to confess, I finally gave up on getting everything to talk to each other so bailed out and used foxserv.

I think richard hit the problem correctly as I was starting to get some communication when I opened winmysqladmin directly - at this point I forgot my wonderfully crafted password/username and hence used foxserv next installation round... [and you thought my username was a joke!]

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
Connecting to mysql withh PHP ramon Beginning PHP 1 October 18th, 2008 03:40 PM
Trouble connecting MySQL to PHP nofences84 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 14th, 2007 11:21 PM
Connecting mysql to php?? Manu Sharma BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 March 5th, 2007 01:40 AM
Connecting To MySQL from PHP AlisP2P MySQL 1 January 4th, 2006 02:27 AM
list_db.php - Connecting to a MYSQL server phpnukes BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 March 3rd, 2004 08:31 PM



All times are GMT -4. The time now is 02:27 PM.


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