Reply
getting started with perl
Old 06-24-2009, 07:54 PM getting started with perl
Novice Talker

Posts: 14
Name: taylor
Trades: 0
ugg,

im trying to manipulate mysql tables using perl. I seem to be having trouble connecting to the database and im guessing im doing a few other things wrong as well. my code looks like this. i upload the code to the cgi-bin provided by my hosting complany and when i go to the url i get a blank page. any ideas? should i be using local host there?


#!/usr/bin/perl


# PERL MODULES WE WILL BE USING
use DBI;
use DBD::mysql;


# HTTP HEADER
print "Content-type: text/html \n\n";


# CONFIG VARIABLES

$database = "sluc@!#$y_!@#!@#project";
$user = "slu@#$#@$#@ch";
$pw = "wa@#$#@23";
$host= "localhost";
$tablename="friends"

# PERL MYSQL CONNECT
$connect = Mysql->connect($host, $database, $user, $pw);
# LISTDBS()
@databases = $connect->listdbs;
foreach $database (@databases) {
print "$database<br />";
}
antioch1st is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-29-2009, 01:54 AM Re: getting started with perl
Super Talker

Posts: 123
Name: vikas
Trades: 0
is your username and password are correct ..
__________________
Free Online Books Collection of free online books and free ebooks |Online pdf Books - Free online pdf books and free pdf eBooks
vikas1234 is offline
Reply With Quote
View Public Profile
 
Old 07-01-2009, 06:48 AM Re: getting started with perl
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
Quote:
#
@databases = $connect->listdbs;
foreach $database (@databases) {
print "$database<br />";
}


your error is putting "s" on the end when naming the array but when calling members of it omitting the s. not an unusual error!
hairygunther is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to getting started with perl
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.10935 seconds with 13 queries