2009-07-29 8 views

答えて

10

DBIplaceholdersを使用できます。ここで

は(this linkから)の例である:

#! /usr/bin/perl 

use DBI; 

print "Enter the city you live in: "; 
chomp($city = <STDIN>); 
print "Enter the state you live in: "; 
chomp($state = <STDIN>); 

$dbh = DBI->connect(your db info here); 
$sth = $dbh->prepare("SELECT name WHERE city = ? AND state = ?"); 
$sth->execute($city, $state); 
+0

おかげ - これは私が探していたものです。 – Dirk

+0

これも私が探していたものです! – Gordon