Fatal Error Call To Undefined Function Mysql_connect Wamp
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about fatal error call to undefined function mysql_connect() xampp hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask fatal error call to undefined function mysql_connect() in php Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join
Fatal Error Call To Undefined Function Mysql_connect() Windows
them; it only takes a minute: Sign up Call to undefined function mysql_connect up vote 18 down vote favorite 2 I just installed PHP and Apache on my home PC. When I try to call function mysql_connect I get:
Fatal Error: Uncaught Error: Call To Undefined Function Mysql_connect() In Xampp
fatal error: call to undefined function mysql_connect. I have loaded php.ini where I have uncommented lines extension=php_mysql.dll and extension=php_mysqli.dll and changed extension directory to extension_dir = "C:\php\ext" - which is the directory where files php_mysql.dll and php_mysqli.dll are. How can I fix this problem? Output of phpinfo(): http://jsfiddle.net/MMTwA/ windows php share|improve this question edited Nov 3 '15 at 9:02 Peter Mortensen 10.2k1369107 asked Dec 18 '11 at 11:28 Nikolas Jíša 3841521 2 Have you restarted apache after uncaught error: call to undefined function mysql_select_db() editing the php.ini? :) And do you also have MySQL installed? Maybe you should have a look at XAMPP (apachefriends.org/en/xampp-windows.html) which is an easy to use package containing apache, php and mysql. –Quasdunk Dec 18 '11 at 11:30 Yes I have restarted it. Yes I have MySQL installed though even if I hadn't I would still get "Undefined function...". I'll probably look at that XAMPP if I don't solve this, thanks. –Nikolas Jíša Dec 18 '11 at 11:56 Try copying the libmysql.dll to C:\Windows\System32. And, again, if you just need a development environment, have a look at XAMPP. It comes with everything integrated, has a GUI, works out of the box and will save you a lot of headache (especially under Windows!). –Quasdunk Dec 18 '11 at 12:23 I have libmysql.dll in C:\Windows\System32 already, I'll try that XAMPP if I dont solve this by evening, thanks. –Nikolas Jíša Dec 18 '11 at 12:28 Providing the contents of might help. –Bryan Dec 18 '11 at 12:32 | show 6 more comments 12 Answers 12 active oldest votes up vote 12 down vote accepted After looking at your phpinfo() output, it appears the mysql extensions are not being loaded. I suspect you might be editing the wrong php.ini file (there might be multiple copies). Make sure you are editing the php file at C:\php\php.ini (
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Uncaught Error Call To Undefined Function Mysql_connect() Php 7
Stack Overflow the company Business Learn more about hiring developers or posting ads with call to undefined function mysql_query() us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is call to undefined function mysql_connect() codeigniter a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2 up vote http://stackoverflow.com/questions/8551398/call-to-undefined-function-mysql-connect 6 down vote favorite 3 Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2 I've spent 11 hours today trying to get past this ONE problem. I have installed: MySQL 5.1 Apache 2.2.14 PHP 5.2.17 these were the versions referred to in the book "PHP and MySQL". When I run the script: where localhost, root and password are the REAL values http://stackoverflow.com/questions/5179535/fatal-error-call-to-undefined-function-mysql-connect-in-c-apache-htdocs-test for this given test system and all I have seen is: Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2 php share|improve this question edited Mar 3 '11 at 10:36 Pekka 웃 304k93697913 asked Mar 3 '11 at 10:33 user389055 911513 add a comment| 3 Answers 3 active oldest votes up vote 14 down vote accepted Uncomment the line extension=php_mysql.dll in your "php.ini" file and restart Apache. Additionally, "libmysql.dll" file must be available to Apache, i.e., it must be either in available in Windows systems PATH or in Apache working directory. See more about installing MySQL extension in manual. P.S. I would advise to consider MySQL extension as deprecated and to use MySQLi or even PDO for working with databases (I prefer PDO). share|improve this answer answered Mar 3 '11 at 10:37 binaryLV 6,7421933 1 use phpinfo() to find out which php.ini is the right one. –Pekka 웃 Mar 3 '11 at 10:38 which php.ini is the right one mins? –user389055 Mar 3 '11 at 10:41 "Uncomment the line extension=php_mysql.dll in your php.ini and restart Apache" i did this allready –user389055 Mar 3 '11 at 10:42 Ensure that extension_dir in "php.ini" points to the correct directory (e.g., "C:/Web/php-5.3.5-Win32-VC6-