List:General Discussion« Previous MessageNext Message »
From:William R. Mattil Date:March 24 1999 10:58pm
Subject:Extracting a given row using Perl API
View as plain text  
Can anyone tell me where the problem here is ???


Given a rather simple table phone
+----------+----------+------------+
|first     |last      |phone       |
+----------+----------+------------+
|Joe       |Blow      |800-555-1212|
+----------+----------+------------+

In this rather simplistic example:

my $sth = $dbh->prepare("SELECT first,last,phone FROM $table WHERE
phone_book.last='Blow'");

works while the following does not;

my $sth = $dbh->prepare("SELECT first,last,phone FROM $table WHERE
phone_book.last=$FOO");

Where $FOO = 'Blow'; And the error message returned is as follows:

DBD::mysql::st execute failed: Unknown column 'Blow' in 'where clause'
at ./find-record line 23.

I'm sure that I am making a grievous error here but just can't see it.
Can anyone shed some light on this ???


Thanks in Advance

Bill
-- 
William R. Mattil	| Fred Astaire wasn't so great.
wrmattil@stripped	| Ginger had to do it all backwards
(972) 399-4106		| and... in high heels.
Thread
Extracting a given row using Perl APIWilliam R. Mattil25 Mar
  • Re: Extracting a given row using Perl APIAldrian Gintingsuka25 Mar
  • Re: Extracting a given row using Perl APIVivek Khera25 Mar
  • Re: Extracting a given row using Perl APIChris25 Mar
  • Re: Bug reportFred van Engen16 Feb
Re: Extracting a given row using Perl APIDerick H Siddoway25 Mar
Re: Extracting a given row using Perl APIVivek Khera25 Mar