i am using PHP,Mysql and IIS server. my problem is that when i am using a mysql_connect() function in my program for connecting database then browser display an error message- Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mysqldemo.php on line 2. i am not understanding how this problem i solve. please help
Probably your PHP hasn't been compiled with the mysql extension - what do you get if you do a phpinfo(INFO_GENERAL); PHP: ?
I don't know how to solve your problem but... I would advise using a more descriptive thread name next time... Then you'll receive more "targetted" views.
in your php.ini, Add the following line to the end Also, make sure MYSQL is linked in PHP by checking
Sir I have get Followinf Output,so what i have to do? System Windows NT KUMAR-SCS 5.1 build 2600 Build Date Feb 7 2007 23:10:31 Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" Server API ISAPI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 Debug Build no Thread Safety enabled Zend Memory Manager enabled IPv6 Support enabled Registered PHP Streams php, file, data, http, ftp, compress.zlib Registered Stream Socket Transports tcp, udp Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*
your password is if root then it's ok. if you not set root password then you have to write like that $con=mysql_connect('localhost','root','');or $con=mysql_connect('localhost','root'); default password is '';
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" Code (markup): MySQL wasn't configured at compile time - you need to ask your ISP (or whoever) to re-compile PHP with MySQL support
this is not the case guys, he is using IIS server and he just hasn't enabled the mysql library in the php.ini
If he can do so, your problem will be solved; as this is the typical error for MySQL lib not being used in php.ini Your IIS server needs to be restarted after modification had been completed. Note that MySQL of course also needs to be installed on the server
sir i put the php.ini file in window folder and made following changes- extension_dir="c:\php\ext" uncomment the file--------- extension=php_mysql.dll\ i have configure the IIS with php with php5isapi.dll file. after this setting i am getting error. phpinfo(); is properly working.