|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
I have a problem with mysql and Perl.
The MySQL database is: DBNAME = postcardsmy USER = postcardadmin PASSW = postx The http and mysql servers are the same. The code is as follows: use mysql; my $dbh = Mysql->connect("localhost", "postcardsmy"); It says that I can't connect to server. I dont have acess to documentation on mysql module so I don't know the correct sintax for the command. |
|
#2
|
|||
|
|||
|
$dbh = DBI->connect("DBI:mysql:$database:$hostname:$port",
$user, $password); |
|
#3
|
|||
|
|||
|
i use this code:
# to connect: $dbh=Mysql->connect("localhost",$database,$user,$password); $dbh->selectdb($database); # to query: $query="select * from users where userName = '$uname'"; $sth = $dbh->query( $query ); @stuff=($sth->fetchrow); hope this is of any help |
|
#4
|
|||
|
|||
|
How do I install this module? When I try to use a file with this I get the error "can't locate object method "connect" via package "mysql" at..."
I am running on a server with other websites but my hosting company are generally happy to install things. Lemming |
|
#5
|
|||
|
|||
|
If in a unix... Try: perl -MCPAN -e shell;
Then in that: i/mysql/ should give you a listing of all the mysql things you can install with install packagename or bundlename. [This message has been edited by Imo (edited 10-20-99).] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Connecting to MySQL using use mysql module |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|