On Nov 18, 2005, at 18:56 , Gayatri wrote:

$host = "nnn.nn.nnn.nn";  ## 'n' is a number, host is ip address.
$databaseName = "MyDatabase";
$dbh = DBI->connect('DBI:mysql:database=$databaseName;host=$host', $userName,
$password, {RaiseError => 1}) || die "Can not connect to database
$DBI::errstr";

I think you need to use double-quotes if you want the $database, $host, $userName, and $password variables to interpolate.

Is this a correct way of doing? Bcoz im getting following err. Is it ok if I mention host ip address, Pls let me know if thr are any other criterias

DBI connect('database=$databaseName;host= $host','ValidUserName',...) failed: Unknown MySQL server host '$host' (11001) at D:\Gayatri\database.pl line 6

Looking at the error, you can see that it's looking for a host $host, not nnn.nn.nnn.nn.

Also, please use vowels and proper capitalization, and don't abbreviate your words. It makes your message more difficult to read for the people who may want to help you. Code can be hard enough to decipher :)

Michael Glaesemann
grzm myrealbox com




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to