Fatal Error Call To Undefined Function Mysql_connect Php 5.3
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 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask 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 them; it only takes a minute: Sign up Undefined function mysql_connect() up vote 11 down vote favorite 7 I have ran aptitude install php5-mysql (and restarted MySQL/Apache 2), but I am still getting this error: Fatal error: Call to undefined function mysql_connect() in /home/validate.php on line 21 phpinfo() says the /etc/php5/apache2/conf.d/pdo_mysql.ini file has been parsed. php mysql ubuntu mysql-connect undefined-function share|improve this question edited Feb 26 at 14:39 Peter Mortensen 10.2k1369107 asked Dec 11 '12 at 17:12 user1765369 1282213 How about other built in PHP/MySql functions? Do they work? –samayo Dec 11 '12 at 17:16 Perhaps not, as I have tried entering incorrect user/pass and my 'or die' statement is not showing! –user1765369 Dec 11 '12 at 17:22 add a comment| 10 Answers 10 active oldest votes up vote 18 down vote accepted Well, this is your chance! It looks like PDO is ready; use that instead. Try checking to see if the PHP MySQL extension module is being loaded: If it's not there, add the following to the php.ini file: extension=php_mysql.dll share|improve this answer edited Feb 26 at 14:40 Peter Mortensen 10.2k1369107 answered Dec 11 '12 at 17:13 wanovak 4,5981424 Is this a better way to connect to a database? I will look into it but I would really like to get this working first as it worked previously until I moved to a new server. –user1765369 Dec 11 '12 at 17:15 1 It is. mysql_* functions are dangerous and deprecated as of PHP 4.1. Check your Apache error logs and restart the server. Does that work? –wanovak Dec 11 '12 at 17:16 I've tried restarting the server, still happens. –user1765369 Dec 11 '12 at 17:21 I'm using xampp, after adding that line to php.ini I get the following message in apache error.log Unable to load dynamic library '\\xampp\\php\\ext\\php_mysql.dll –maufkk Jan 9 at 1:17 @defmx Does the .dll file exist at that path? If not you need to install it. –wanovak Jan 18 at 21:26 add a comment| up vote 26 down vote I see that you tagged this with Ubuntu. Most likely the MySQL driver (and possibly MySQL) is not installed. Assuming you have S
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 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask 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 them; it only takes a minute: Sign up Fatal error: Call to undefined function mysql_connect() http://stackoverflow.com/questions/13825108/undefined-function-mysql-connect in C:\Apache\htdocs\test.php on line 2 up vote 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: http://stackoverflow.com/questions/5179535/fatal-error-call-to-undefined-function-mysql-connect-in-c-apache-htdocs-test 'password'); ?> where localhost, root and password are the REAL values 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 t
Web Platform Installer Get Help: Ask a Question in our Forums More Help Resources Blogs Forums Home IIS.NET Forums Partner and Community Forums PHP Community https://forums.iis.net/t/prev/1230334 PHP Fatal error: Call to undefined function mysql_connect() PHP Fatal error: Call to undefined function mysql_connect() RSS 3 replies Last post Mar 22, 2016 07:42 PM by DropPhone ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Advanced Search Reply PacoRenteria 1 Post PHP Fatal error: Call to undefined function mysql_connect() fatal error Jan 22, 2015 05:43 PM|PacoRenteria|LINK Greetings Fellows, I am having this problem in just one page! PHP Fatal error: Call to undefined function mysql_connect() I am using IIS8.0 with PHP 5.3, the problem is ONLY on one page and I have tried everything that has come to my mind. Even replaced the code with other copied from a fatal error call working page and surprisingly, it doesn't work. I have checked and double checked the page sintaxis and still doesn't work. ¿any ideas? Thx in advance. mysql mssql_connect php Reply DropPhone 295 Posts MicrosoftModerator Re: PHP Fatal error: Call to undefined function mysql_connect() Jan 26, 2015 05:44 PM|DropPhone|LINK Just checking: is the extension=php_mysql.dll enabled inyour php.ini file? You may also need to uncomment the extension=php_pdo_mysql.dll and the extension=php_mysqli.dll lines as well. Thx! --E. mysql mssql_connect php Reply Onret 1 Post Re: PHP Fatal error: Call to undefined function mysql_connect() Mar 09, 2016 07:30 AM|Onret|LINK I have the same problem (exept running on iis10 and have php 7.0.3). I could only find "extension=php_mysqli.dll" in my .ini file and have tried to write in "extension=php_mysql.dll" and paste a downloaded php_mysql.dll in the /ext/ directory. Didn't work. I have also uncommented the lines you suggested. I would really appreciate your help. Reply DropPhone 295 Posts MicrosoftModerator Re: PHP Fatal error: Call to undefined function mysql_connect() Mar 22, 2016 07:42 PM|DropPhone|LINK Onret I have the same problem (exept