Re: searching database on emailaddress field
- From: ron@xxxxxxxxxxxxx (Ron Savage)
- Date: Tue, 31 Jan 2006 15:04:04 +1100
On Tue, 31 Jan 2006 14:24:44 +1030, luke@xxxxxxxxxxxxxxx wrote:
Hi Luke
> Solved after I posted.
> Surround $email with 's.
> As in '$email'.
Nice try, but no cigar. See below.
>> my $sth = $dbh->prepare("select id, address from subs_email where
>> address=".$email); $sth->execute(); my @array = $sth->fetchrow;
my $sth = $dbh->prepare('select id, address from subs_email where
address=?');
$sth->execute($email);
This way, the value in $email is quoted correctly by DBI, so you don't need to
call $dbh -> quote() explicitly, which you were doing, right?
--
Ron Savage
ron@xxxxxxxxxxxxx
http://savage.net.au/index.html
.
- References:
- Re: searching database on emailaddress field
- From: luke
- Re: searching database on emailaddress field
- Prev by Date: Re: searching database on emailaddress field
- Next by Date: AW: searching database on emailaddress field
- Previous by thread: Re: searching database on emailaddress field
- Next by thread: Re: searching database on emailaddress field
- Index(es):