> Thanks but I plead total perl ignorance.
> As far as I can tell this doesn't run by itself.
> What do I do with it?

The connect string needs to be executed first. It returns a a database
handle that is used for other db commands. 

Here is a typical Mysql sequence:-

#connect
$dbh =>
DBI->connect("DBI:mysql:$database:$host",$usr,$pswd,{PrintError=>1});
         die "can't connect to MySQL server ($SQLSERVER)" if
!defined($dbh);

#prepare some sql
$sth=$dbh->prepare($sql); # where $sql is valid sql e.g
                           $sql = " select * from mytable";
#execute sql 
$sth->execute;

#fetch  a row of data
$row = $sth->fetchrow_arrayref;

# do more sql stuff here if you want


#disconnect
$dbh->disconnect;

> 
> Where do the $mp3db, $host, #usr, $pswd  get defined?
> What is $mp3db? Is this your database?

These are the connect string variables. You define them. Yup $mp3db is
the variable I'm using for my, strangly enough, mp3 database. 

> 
> I will try looking for perl stuff at freshmeat and search.cpan.org (if
> they are both working).
> 
> Sigh, this is another case of O'Reilly books being only for those who
> already know what they are doing. I spoke to Tim O'Reilly about this
> about seven years ago, over the Awk book, but it seems he hasn't taken
> it on board.
>

I'd be getting a feel for the whole object orientated perl thing before
diving into databses etc. The DBI and DBD modules use the object model.

Unless anyone else has a magic solution I think you are going to be in
for a bit of a slog. Reading code, writing code, checking news groups
etc etc.

 
> --
>    Terry Collins {:-)}}} Ph(02) 4627 2186 Fax(02) 4628 7861
>    email: [EMAIL PROTECTED]  www: http://www.woa.com.au
>    WOA Computer Services <lan/wan, linux/unix, novell>
> 
>  "People without trees are like fish without clean water"
> 
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to