Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases 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 May 18th, 2006, 07:26 AM
Registered User
 
Join Date: May 2006
Location: Arbúcies, , Spain.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with mysql_connect()

I have got a problem with function mysql_connect(). When I use the function in order to create a database, it returns me thi error:

Fatal error: Call to undefined function mysql_connect() in F:\Apache Group\Apache2\test\createmovie.php on line 4

What can I do?

Reply With Quote
  #2 (permalink)  
Old May 18th, 2006, 07:38 AM
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

You need to install the mysql extension, it isn't installed by default in PHP 5.

Read the manual and user notes at:
http://www.php.net/mysql



Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote
  #3 (permalink)  
Old May 18th, 2006, 08:08 AM
Registered User
 
Join Date: May 2006
Location: Arbúcies, , Spain.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much, I'll do.

Reply With Quote
  #4 (permalink)  
Old May 18th, 2006, 08:46 AM
Registered User
 
Join Date: May 2006
Location: Arbúcies, , Spain.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've do it, but I've got
;extension=php_mysql.dll
by default and it continues without working.

Reply With Quote
  #5 (permalink)  
Old May 24th, 2006, 11:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should probably take a look at using the MySQLi (i==improved) libraries, instead: they're the default in PHP 5, anyway. The others are kinda deprecated.
Reply With Quote
  #6 (permalink)  
Old May 24th, 2006, 12:01 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

The old "mysql" extension is not marked deprecated, AFAIK. You should, however, use the mysqli extension if MySQL is version 4.1 or later.

> I've do it, but I've got
> ;extension=php_mysql.dll
> by default and it continues without working.

You must uncomment the extension to install it, by removing the semi-colon from in front of it, assuming you are on Windows. You'll also have to place the libmysql.dll file in the system path. Read all about that on the http://www.php.net/mysql page, or http://www.php.net/mysqli if you're using MySQL 4.1 or later.

If you're on a Linux server, you'll want to do something like

yum install mysql mysql-server php-mysql php-mysqli

Or find the RPMs and install them that way, or install from source.

HTH!

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
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
i can not use the mysql_connect() function g.tamilselvan MySQL 2 February 14th, 2006 09:03 AM
Call to undefined function mysql_connect() tks_muthu PHP Databases 2 June 14th, 2005 01:23 AM
mysql_connect() will not connect!!!! crazyfool PHP Databases 3 February 26th, 2005 11:09 AM
undefined function: mysql_connect() shabboleth Beginning PHP 2 September 18th, 2003 05:09 PM



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


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