Re: searching database on emailaddress field



Hi.

Solved after I posted.
Surround $email with 's.
As in '$email'.

Thanks.
Kr.
Luke.

31Jan2006 @ 13:52 luke@xxxxxxxxxxxxxxx thusly spake
> 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:

--
.............._..
..| .| |.|/.|_ .
..|__.|_|.|\.|_ .
:61 421 276 282:
.



Relevant Pages

  • searching database on emailaddress field
    ... I'm trying to work out how to search a database by emailaddress. ... Luke. ... Prev by Date: ...
    (perl.dbi.users)
  • Re: Editable forms with 1000 elements
    ... not about the database that stores the answers/values. ... This will become increasingly difficult if the HTML is all screwed up ... Best of luck, Luke. ...
    (comp.lang.php)
  • Re: MSDE and VS.NET Quickstart Tutorials
    ... SQL Server does not exist or access denied. ... > hi Luke, ... >> I suspect that the database files may have been corrupted or tables ... > you then have to re-run the pubs install script.. ...
    (microsoft.public.sqlserver.msde)
  • Re: Problem with Dlookup function
    ... No, the database has not arrived yet, nor did the original one arrive. ... I apologize that I cannot post the full email address here. ... Ken Snell <MS ACCESS MVP> "Luke" wrote in message ... > know if you have it (the subject is: Problem with Dlookup function from> Luke). ...
    (microsoft.public.access.modulesdaovba)
  • Re: File reading vulnerable in PHP and MySQL (Local Exploit)
    ... > # Create a database (mySQL) and upload this file to your server ... > PHP Code: viewfile.php (programmed by Luke) ...
    (Bugtraq)