our approach
|
new tutorials
|
contact us
MySQL Basics In Pictures
Starting
Administration
Tables
Queries
Security
Web
Make a connection to the database:
my $dbh = DBI->
connect(
specify connection info, user id and password variables here, separated by commas
);
TIP:
Remember that the Perl database interface (DBI) module connects to the MySQL server with the filehandle
$dbh
,
using
$connectionInfo
,
$userid
,
and
$passwd
.
Prepare a query that selects all of the quotations and the president who said each:
my $query = "
write your query here
";
Execute the query:
my $sth = $dbh->prepare($query);
$sth->execute();
Assign fields to the variables:
my (
list variables here, separated by commas
);
$sth->bind_columns(undef, \
specify first variable here
, \
specify second variable here
, \
specify third variable here
, \
specify fourth variable here
);
<< BACK
NEXT >>