470,620 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,620 developers. It's quick & easy.

Trouble connecting to MySQL using mysqli extension on XP

I had a tough time getting PHP to connect to MySQL using mysqli on XP.
The following code from the php documentation on mysqli failed to work
on xp.

$mysqli = new mysqli( "localhost", "user", "password", "database" );

Where localhost, user, password, and database where replaced with the
appropriate values.
I left the host parameter as "localhost" because that's what I wanted,
however that did not work.
So I changed it to NULL, which defaults to localhost as per the
documentation, but this still did not work.

After some googling, I found the answer on another forum, which stated
that the host should be a dot ".", but no other explanation was given.

Is there anyone that can shed some light on the situation?
I would really like to know why I can't use "localhost", and why this
isn't documented.

I've tried every mysqli option imaginable in the php.ini file.
It seems that host must be a dot.
Jul 16 '08 #1
0 1011

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Penn Markham | last post: by
2 posts views Thread by Pjotr Wedersteers | last post: by
5 posts views Thread by php-newbe | last post: by
reply views Thread by ojorus | last post: by
18 posts views Thread by Bruce A. Julseth | last post: by
9 posts views Thread by christopher_board | last post: by
11 posts views Thread by macca | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.