Call to undefined function mysql_connect()

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Call to undefined function mysql_connect()

Postby yeaziwei » 12. October 2008 09:35

I am new to this XAMPP and Php development.

I have installed xampp, and while I try to conenct my MySQL database
I hit this error.

Fatal error: Call to undefined function mysql_connect() in C:\xampp\htdocs\workspace\kopitiam\connection.php on line 7I

I have tried to uncomment my php_mysql.dll. but it dosent' work.

anyone can tell give me some clause?
Newbie in php, trying XAMPP 1.6.8, development in ECLIPSE
yeaziwei
 
Posts: 7
Joined: 11. October 2008 16:29

Postby Wiedmann » 12. October 2008 09:36

Your PHP is using a wrong "php.ini"?

(verify with phpinfo())
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby yeaziwei » 12. October 2008 09:44

i have changed both php.ini at the following directory

C:\xampp\apache\bin

and

C:\xampp\php

I not sure both are correct or not. any suggestion?

and
What should I check on the phpinfo();?????
Newbie in php, trying XAMPP 1.6.8, development in ECLIPSE
yeaziwei
 
Posts: 7
Joined: 11. October 2008 16:29

Postby Wiedmann » 12. October 2008 10:10

What should I check on the phpinfo();?????

Which "php.ini" your PHP is using. ("loaded configuration file...")
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby yeaziwei » 12. October 2008 12:27

loaded configuration file


It is current pointed to C:\xampp\apache\bin

and

my php.ini is uncommented.

;extension=php_mcrypt_filter.dll
;extension=php_memcache.dll
;extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
extension=php_msql.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_netools.dll
;extension=php_ntuser.dll
;extension=php_oracle.dll
;extension=php_oci8.dll
;extension=php_oggvorbis.dll
;extension=php_openssl.dll
;extension=php_parsekit.dll...........
Newbie in php, trying XAMPP 1.6.8, development in ECLIPSE
yeaziwei
 
Posts: 7
Joined: 11. October 2008 16:29

Postby glitzi85 » 12. October 2008 17:31

You should be able to connect to MySQL without any problems as the mysql support in php shipped with XAMPP is enabled by default!

If you open http://localhost/phpmyadmin do you get any error messages?

If not, please post your Code here!

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby yeaziwei » 13. October 2008 02:41

my phpMySQLadmin has the following error.


Cannot load mysql extension. Please check your PHP configuration. - Documentation

Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.
Newbie in php, trying XAMPP 1.6.8, development in ECLIPSE
yeaziwei
 
Posts: 7
Joined: 11. October 2008 16:29

Postby Wiedmann » 13. October 2008 06:47

Anything in Apache's "error.log"?

Try also to change "display_startup_errors" from "Off" to "On" in "php.ini", restart Apache, and look into "error.log".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby yeaziwei » 15. October 2008 09:10

Yes, I hit error.

There is a error message pop-up.

says ..
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_mysql.dll' -
This application has failed to start because the application configuration is
incorrect.[/url]
Newbie in php, trying XAMPP 1.6.8, development in ECLIPSE
yeaziwei
 
Posts: 7
Joined: 11. October 2008 16:29


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 129 guests