php+mysql Fatal error: Call to undefined function mysql_connect() in -
i have searched internet troubleshooting "call undefined function mysql_connect() " error none of suggested procedures works...
when try access mysql php, error. have php version 5.2.17 , mysql 5.1.68 (mysql running outside php, tried creating tables , databases etc.).
i uncomment extensions in php.ini:
extension=php_mysql.dll extension=php_mysqli.dll and specified path these extensions.
i added both php , mysql path variable. using apache 2.2. , restarted server after every change made.
this code in php accessing database (but suppose problem not in syntax):
<?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'pasw'; $dbname = 'db'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('error connecting mysql'); mysql_select_db($dbname); ?> i out of ideas how fix this, can u suggest other troubleshooting tips? quite new problematics... use mysql, cause thats use on actual server when i´ll have website , running. in advance!
edit: apache log:
[mon mar 25 13:50:42 2013] [error] [client 127.0.0.1] php fatal error: call undefined function mysql_connect() in c:\\web\\thenemis\\dbconnect.php on line 7, referer: http://localhost/thenemis/admin.php [mon mar 25 13:50:42 2013] [error] [client 127.0.0.1] file not exist: c:/web/favicon.ico edit2: php info (i think problem may unspecified parametres in php.ini file). havent read anywhere should specify other features extensions , path them maybe wrong... suggest?
mysql mysql support enabled active persistent links 0 active links 0 client api version 5.0.51a directive local value master value mysql.allow_persistent on on mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links unlimited unlimited mysql.max_persistent unlimited unlimited mysql.trace_mode off off
as said use phpinfo() determining if mysql running correctly. in general should not use mysql anymore more rather new improved version of mysql, called mysqli http://php.net/manual/de/book.mysqli.php
you can in addition programmatically check if function exists method_exists method
Comments
Post a Comment