Re: mysql_connect() undefined



jbo wrote:
When I try this in a php script :
$conn = mysql_connect("localhost", "joeuser", "joeuser");
I get this error message:
 PHP Fatal error: Call to undefined function mysql_connect() in
C:\Inetpub\wwwroot\test.php on line 5
My system :
    w2K Pro.  running IIS 5.0,
    MySQL is version is 4.4.14nt
    php is 5.0.5
I can access web pages, run the mysql monitor and do sql commands and php
works I think because I can do a phpinfo() and get all the php system info.

What am I missing?


Is PHP configured with mysql support enabled ? My phpinfo() reveals:
Configure Command './configure' '--with-mysql=/usr/local/mysql' '--with-apache=../apache_1.3.33' '--enable-safe-mode'


Of course your box is windows, but something similar should be present I suppose. If not sure, check www.php.net for use with mysql.

Sh
.



Relevant Pages

  • Re: Access violation PHP 5.2.8 on IIS
    ... Just started PHP and MySQL ... I installed PHP 5.2.8 on XP running IIS and MySQL ... you should not get an access violation. ...
    (comp.lang.php)
  • Re: Stupid question
    ... I am running IIS (Not by choice - I'd much rather Apache when ... i'm playing with PHP and MySQL) and I checked the PHP.ini file. ...
    (php.general)
  • Access violation PHP 5.2.8 on IIS
    ... Just started PHP and MySQL ... I installed PHP 5.2.8 on XP running IIS and MySQL ... $query = 'SELECT itemid, name FROM items'; ...
    (comp.lang.php)
  • mysql_connect() undefined
    ... PHP Fatal error: Call to undefined function mysql_connectin ... running IIS 5.0, ... php is 5.0.5 ... run the mysql monitor and do sql commands and php ...
    (php.general)
  • cannot connect to mysql from command line
    ... i have some php installation issue on a preinstalled dedicated server. ... i can access mysql through php via webserver withouth problem. ... PHP Fatal error: Call to undefined function mysql_connect.. ...
    (php.general)