AW: searching database on emailaddress field



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:

.



Relevant Pages

  • Re: Convert from WrapText
    ... Will try memo. ... Regards. ... > A record in Access or any other database is one row. ... >> the data in as close a manner as to that displayed in Excel, ...
    (microsoft.public.excel.programming)
  • Re: DSNLess connection
    ... Regards ... DO NOT stick the database in reach of the outside world (stick it ... > Steven Burn ... > Ur I.T. Mate Group ...
    (microsoft.public.inetserver.asp.db)
  • Re: mailmerge new page
    ... I always did use a database field. ... MsWord tells me I can't do mailmerge to email? ...
    (microsoft.public.word.mailmerge.fields)
  • Re: US car dealer software
    ... I have only been in the MV business for 30 years, ... >>> you did a sample of US car dealerships asking which database they use, ... >>> Regards ... Both R&R and ADP have been around for years and both ...
    (comp.databases.pick)
  • Re: Windows 2003 SBS: Memory Leak?
    ... > It's an absolute fact that you should not scan database files with an AV ... > file scanner that intends to find virus patterns in the database, ... >> Best regards, ... >> Craig. ...
    (microsoft.public.windows.server.sbs)