|
Posted by None on 08/01/05 04:05
Hello,
Im getting a Debug Warning: C:\wamp\www\php5\connection.php line 8 -
mysql_connect(): Unknown MySQL Server Host '$host' (11001)
I thought I was passing "localhost" to the function?
<?php
#Database Connection Class
#Inputs: $host,$user,password
class connDb{
var $resourse;
function Conn($host,$user,$pass){
$link = mysql_connect('$host', '$user', '$pass');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sean");
$resourse=$link;
}
}
?>
#Test Script
<?php
$connTest = new connDb;
$connTest->Conn("localhost", "root", "");
echo '$resourse';
?>
Thanks
Mike
Navigation:
[Reply to this message]
|