At 10:49 PM 5/3/2001 +0200, you wrote:
>On Thu, May 03, 2001 at 04:44:03PM -0400, Ian LeBlanc wrote:
> > Oliver:
> > use strict; <----- this line
>
>ah, it's to force you to program correctely :)
>(to define variables, etc.)
>
>It will also work if you comment it, no problem.
>
>Olivier
Thanks.. now I know that.. got it working with that line in there...
Is anyone interested in adding mysql support into your scripts ....
email me...
you will first have to install 3 more modules on to your server.
1. DBI-1.15 - so that your script can use a data source.
2. Data-ShowTable-3.3 - needed *can't remember why.. but wouldn't work
without it.
3. Msql-Mysql-modules-1.2215 - the mysql.pm file (make it possible to
connect to the mysql or msql database)
NOTE** they need to all be installed in that order also.. all are available
from http://search.cpan.org
Here is an example connect in perl.
#!/usr/bin/perl
# Connects to mysql DB with perl
# Created by Ian LeBlanc (ian@...)
########################################
use Mysql;
my $sverigedb_host = "localhost";
my $sverigedb_name = "database";
my $sverigedb_user = "database_username";
my $sverigedb_password = "database_password";
#######################################################################
## You shouldn't have to modify anything below this line except the SQL
statement ##
#######################################################################
my $db =
Mysql->connect($sverigedb_host,$sverigedb_name,$sverigedb_user,$sverigedb_password);
my $dbu = $db->Query("SELECT fieldname FROM table WHERE value='thisvalue'
ORDER BY fieldname;");
my @yomama = $dbu->fetchcol(0);
while (my $who = shift @yomama)
{
print("$who<br>\n");
};
exit;
==========================
Prior knowledge of SQL is advisable.
http://www.mysql.com can help
==========================
Regards,
Ian LeBlanc
Web Development
Rask, Inc. - http://www.rask.com
Phone: (727) 517-2000
Fax: (727) 517-2001
|