AW: searching database on emailaddress field
- From: perl@xxxxxxxxxxxxxxxx (Renee Backer)
- Date: Tue, 31 Jan 2006 05:10:43 +0100
Hi Luke,
you should have a look at the "Placeholder and Bind Values" section
in the DBI documentation:
http://search.cpan.org/~timb/DBI-1.50/DBI.pm#Placeholders_and_Bind_Values
regards,
Renee
-----Ursprungliche Nachricht-----
Von: luke@xxxxxxxxxxxxxxx [mailto:luke@xxxxxxxxxxxxxxx]
Gesendet: Dienstag, 31. Januar 2006 04:23
An: dbi-users@xxxxxxxx
Betreff: searching database on emailaddress field
Hi.
I'm trying to work out how to search a database by emailaddress.
I'd like to see if an emailaddress exists in a database already.
The code looks like this:
/~~~~~~~~~~~~~~~~~~~~~~~~~~~
my $email = 'foo@xxxxxxx';
my $sth = $dbh->prepare("select id, address from subs_email where
address=".$email);
$sth->execute();
my @array = $sth->fetchrow;
print $array[1] . "\n";
\___________________________
I can't seem to use the '@' char in the email address.
I get the following error:
DBD::Pg::st execute failed: ERROR: column "foo" does not exist at
../testTime.pl line 178.
DBD::Pg::st fetchrow failed: no statement executing at ./testTime.pl line
179.
Thanks for any help.
Kind regards.
Luke.
--
.............._..
..| .| |.|/.|_ .
..|__.|_|.|\.|_ .
:61 421 276 282:
.
- References:
- searching database on emailaddress field
- From: luke
- searching database on emailaddress field
- Prev by Date: Re: searching database on emailaddress field
- Next by Date: Re: Message from Maintainer to DBD::mysql users, developers
- Previous by thread: Re: searching database on emailaddress field
- Next by thread: Extracting files using DBI
- Index(es):
Relevant Pages
|
|