List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:October 21 2003 11:48am
Subject:Re: Select statement
View as plain text  
mark o' sullivan wrote:

> completionDate, successMeasuredBy FROM waitingroom WHERE '$user =
> candidate'"); 

How about

    $user='candidate'

And, besides, read the secion on placeholders in the DBI manual. Note,
that your own name contains a single quote and will most likely break
the syntax when inserted into the database using that name. In other
words, better use

    $sth = $dbh->prepare("SELECT candidate,task, estimatedSize, approved,
                         completionDate, successMeasuredBy FROM waitingroom
                         WHERE ?='candidate'");
    $sth->execute($user);


Jochen


Thread
Select statementmark o' sullivan21 Oct
  • Re: Select statementJochen Wiedmann21 Oct