MySQL Forums
Forum List  »  PHP

php and mysql confuguration problems
Posted by: ahmed
Date: February 06, 2006 11:12AM

Hello there,
i installed php version 5 and then mysql ver. 5 and my webserver is iis..in windows XP. when i tried to run the following simple code to test my databse connection i get the following error -->

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\table.php on line 5

the code i used is:
<?php
$username = "";
$password = "root";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
$selected = mysql_select_db("first_test",$dbh)
or die("Could not select first_test");
// you're going to do lots more here soon
mysql_close($dbh);
?>


then i made changes in the following areas :

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\Program_Files\php\ext"
.
.
.
.
.
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
:extension=php_msql.dll
;extension=php_mysql.dll <-------- when i removed the semi-colen...and when i tried to
run my script i get an error saying
unable to laod mysql and mysqli dll's.
;extension=php_mysqli.dll <--------

;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll


so please give me a solution to work on php and mysql...

thank you..

ahmed

Options: ReplyQuote


Subject
Written By
Posted
php and mysql confuguration problems
February 06, 2006 11:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.