Fatal Error Call To Undefined Function Mysql_connect In Php Linux
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 call to undefined function mysql_connect() windows About Us Learn more about Stack Overflow the company Business Learn more about call to undefined function mysql_connect() codeigniter hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss call to undefined function mysql_pconnect 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
Fatal Error Call To Undefined Function Mysql_connect() Xampp
undefined function mysql_connect() up vote 21 down vote favorite 6 I have set up PHP, MySQL, and Apache. localhost() for PHP and it is working well. But after I downloaded MySQL, it reports: Fatal error: Call to undefined function mysql_connect() How can I fix this? php mysql share|improve this question edited Jun 10 at 7:19 Tirthraj Barot 1,3092622 asked May 16 '12 at 9:16 pepsicode call to undefined function mysql_connect() ubuntu 1472310 Did you restart apache after you installed the packages? –Devator May 16 '12 at 9:17 nz.php.net/manual/en/mysql.installation.php –zerkms May 16 '12 at 9:17 1 You tagged your question [mysql-error-1064] - how do you get that if your script can't communicate with MySQL? –Repox May 16 '12 at 9:20 5 If mysqli or PDO works then you're better off using them instead anyway. –GordonM May 16 '12 at 9:21 6 @GordonM is quite right. The mysql_* functions are deprecated. There are better alternatives that support parameterized queries. –pilcrow Jul 7 '12 at 14:03 | show 1 more comment 10 Answers 10 active oldest votes up vote 22 down vote Open your terminal and run bellow command. sudo apt-get install mysql-server If you are running PHP you will also need to install the php module for mysql 5: sudo apt-get install php5-mysql share|improve this answer edited Sep 13 at 7:11 answered Feb 14 '13 at 12:19 Nanhe Kumar 5,05712430 add a comment| up vote 6 down vote Verify that your installation of PHP has been compiled with mysql support. Create a test web page containing
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 call to undefined function mysql_connect() php 7 About Us Learn more about Stack Overflow the company Business Learn more
Call To Undefined Function Mysql_select_db()
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Php 7 Mysql_connect
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() http://stackoverflow.com/questions/10615436/fatal-error-call-to-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 http://stackoverflow.com/questions/13825108/undefined-function-mysql-connect 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 wor
#1 2012-03-22 04:31:04 clandest Member Registered: 2012-03-16 Posts: 22 getting Fatal error: Call to undefined function mysql_connect() error. ok, so before I https://bbs.archlinux.org/viewtopic.php?id=138131 had my mysql_connect php script and it ran fine, no errors, but once I changed my php.ini file to give ERROR_REPORTING E_ALL I now get Fatal error: http://board.phpbuilder.com/showthread.php?10371200-RESOLVED-i-am-Fatal-error-Call-to-undefined-function-mysql_connect()-using-php5-2-mysql-4-1 Call to undefined function mysql_connect(). I am just wondering how I can fix this?I followed the arch linux LAMP wiki and I can't figure out why call to I am getting this error after turnning on error_reporting. Thanksthis is my php code Last edited by clandest (2012-03-22 04:36:43) Offline #2 call to undefined 2012-03-22 04:45:24 astiak Member From: London, UK Registered: 2010-12-14 Posts: 13 Re: getting Fatal error: Call to undefined function mysql_connect() error. Can you verify whether the following two lines in your php.ini have been uncommented?;extension=mysqli.so ;extension=mysql.soIf not, uncomment both, restart apache and it should resolve your issue. Offline #3 2012-03-22 16:21:48 clandest Member Registered: 2012-03-16 Posts: 22 Re: getting Fatal error: Call to undefined function mysql_connect() error. astiak wrote:Can you verify whether the following two lines in your php.ini have been uncommented?;extension=mysqli.so ;extension=mysql.soIf not, uncomment both, restart apache and it should resolve your issue.yes, both of those were uncommented. I made sure to check that when the problem occurred. Thanks Offline #4 2012-03-22 17:50:56 astiak Member From: London, UK Registered: 2010-12-14 Posts: 13 Re: getting Fatal error: Call to undefined function mysql_connect() error. Your php code is absolutely fine.Do you have the mysql modules showing up in the output of "php -m"? Offline #5 2012-03-22 17:52:19
using php5.2,mysql 4.1 If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Page 1 of 2 12 Last Jump to page: Results 1 to 15 of 21 Thread: [RESOLVED] i am Fatal error: Call to undefined function mysql_connect() using php5.2,mysql 4.1 Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 02-08-2010,10:06 AM #1 thread_PHP View Profile View Forum Posts Senior Member Join Date Jan 2006 Posts 323 [RESOLVED] i am Fatal error: Call to undefined function mysql_connect() using php5.2,mysql 4.1 hi all i am getting following error while i am using php 5.2.12 and mysql4.1 in windows Fatal error: Call to undefined function mysql_connect() please help me to solve my problem thanks in advance "Speak your truth quietly and clearly, and listen to others, even the dull and ignorant, they too have their story. " Reply With Quote 02-08-2010,10:25 AM #2 halojoy View Profile View Forum Posts Visit Homepage phpMaster Join Date Jun 2005 Location Europe Posts 2,992 Run a phpinfo() to see if the php_mysql extension module is loaded. If it is not, you should activate mysql extension. For example in php.ini: extension=php_mysql.dll PHP Code:
Apache2.4.18 (Win64) / PHP5.6.19 / MySQL5.7.11 / phpMyAdmin4.6.0 Reply With Quote 02-08-2010,02:23 PM #3 bradgrafelman View Profile View Forum Posts Visit Homepage Pna lbh ernq guvf¿ Join Date Jul 2004 Location Kansas City area Posts 19,435 Moved to Install forum. If enabling the "extesion=" line in your php.ini file doesn't work, read over the FAQ stickied at the top of this forum (specifically, the post entitled "2. PHP5 :: Can't use mysql_*() functions"). If neither of those solves your problem, let us know. Reply With Quote 02-10-2010,05:03 AM #4 thread_PHP View Profile View Forum Posts Senior Member Join Date Jan 2006 Posts 323 hi halojoy i am sending you following files containing my phpinfo files Attached Images 3.jpg (92.2 KB, 3146 views) "Speak your truth quietly and clearly, and listen to others, even the dull and ignorant, they too have their story. " Reply With Quote 02-10-2010,0
phpinfo();
?>