warning in connection..help..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
finch_emo44
Forum Newbie
Posts: 5
Joined: Wed Jul 08, 2009 8:24 am

warning in connection..help..

Post by finch_emo44 »

i got this warning message:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host '�localhost�' (11004) in C:\[loc]\default.php on line 16

code here:

<?php

$user=”root”;
$host='http://localhost';
$password=””;

$connection = mysql_connect($host,$user,$password); //line 16

?>

what's the problem here?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: warning in connection..help..

Post by superdezign »

Is MySQL running?
Normally, that error means that MySQL isn't running on the server. You need to turn it on in order to use it locally.
finch_emo44
Forum Newbie
Posts: 5
Joined: Wed Jul 08, 2009 8:24 am

Re: warning in connection..help..

Post by finch_emo44 »

yup, i'm using mysql 5..

I also tried this: http://www.phplivesupport.com/documenta ... d=35&pid=1

mine said that it is succesful..

any suggestion?
SvanteH
Forum Commoner
Posts: 50
Joined: Wed Jul 08, 2009 12:25 am

Re: warning in connection..help..

Post by SvanteH »

Code: Select all

$host='http://localhost';
->

Code: Select all

$host='localhost';
Post Reply