Page 1 of 1

Connection problem ???

Posted: Thu Jun 16, 2005 3:14 pm
by roland E W Mucke
Hi there,

I have installed Apache, PhP5, MySQL and all is working fine no problem. But if I want to connect to MySQL through PhP NO GO.

Can somebody be of help please.

I can do everything in MySQL with command prompt, and I got the

Code: Select all

&quote;root@localhost&quote;, as I ask SELECT USER();
Standard setting:

Code: Select all

$connect = mysql_connect("localhost", "root", "password")
This is what I was using:

Code: Select all

$connect = mysql_connect("root@localhost", "username", "password")
Thanks in advance aktell

Re: Connection problem ???

Posted: Thu Jun 16, 2005 3:18 pm
by hawleyjr
roland E W Mucke wrote:
Standard setting:

Code: Select all

$connect = mysql_connect("localhost", "root", "password")
This is what I was using:

Code: Select all

$connect = mysql_connect("root@localhost", "username", "password")
Thanks in advance aktell
The first param needs to be localhost or an IP address not the username.

Code: Select all

mysql_connect ( їstring server ї, string username ї, string password...)

Posted: Thu Jun 16, 2005 4:35 pm
by roland E W Mucke
Hi there again,

I have installed MySQLAdministrator and checked so it would be right to use the following:

Code: Select all

$connect = mysql_connect("localhost", "root", "password")
but unfortunatly it still does not want to go. I get this message in the browser IE6

Code: Select all

Fatal error: Call to undefined function mysql_connect()
Thanks aktell

Posted: Thu Jun 16, 2005 4:57 pm
by John Cartwright
You must enable your mysql in the php.ini. If I'm not mistaken you have PHP5 and mysql support is turned off by default.

Uncomment
#extension=php_mysql.dll