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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 31. Januar 2006 04:23
An: dbi-users@perl.org
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 = '[EMAIL PROTECTED]';
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:

Reply via email to