Connection problem ???

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
roland E W Mucke
Forum Newbie
Posts: 4
Joined: Thu Jun 16, 2005 2:56 pm
Location: New Zealand

Connection problem ???

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Re: Connection problem ???

Post 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...)
roland E W Mucke
Forum Newbie
Posts: 4
Joined: Thu Jun 16, 2005 2:56 pm
Location: New Zealand

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
Post Reply