PDA

View Full Version : newbie q - can't connect



xit
11-16-2003, 11:59 PM
Hello,

I've seen what MySql can do and I'll love to learn it, so I got a book and some tutorials and it seems that I still clueless... I can't even connect to a database :( does anyone knows whats wrong with it:

______________________________
#!/bin/perl

use DBI;

$driver = "DBI:mysql";
$database = "test";

$dbh = DBI -> connect ("$driver:$database", "root", "xxxxxx")
or die "No se pudo establecer la conexion con la base de datos";

$rc = $dbh -> disconnect;

______________________________

Perhaps username, syntax, vars... ????

xIt

jalal
11-17-2003, 01:52 AM
What error do you get?
Does the database exist?

Unless you are already familiar with Perl, you may find it easier to start off with PHP/MySQL.

wildjokerdesign
11-17-2003, 04:11 PM
Also do you have phpMyAdmin installed on your account? For that matter do you have MySql installed?


Looking at the database in phpMyAdmin did alot for me to understand things. Could have been all the links to info that I kept clicking on and reading.

xit
11-19-2003, 01:02 PM
Hi!

I choosed perl because I already am a bit familiar with it... and the problem was something really fool: I never specified the type of output (in this case print "Content-type: text/html\n\n"; ) so the server marked error because didn't knew how to show results or something...

Any way thank you guys!

xIt