Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: MySQL Select problem

by kabel (Chaplain)
on Oct 09, 2002 at 15:02 UTC ( #203943=note: print w/ replies, xml ) Need Help??


in reply to MySQL Select problem

you have a quoting problem. consider this examples:

C:\Perl Testskripte\580>perl use strict; my $name = "kabel"; my $sql_statement = "select * from users where name like '%$name%'"; print "executing [$sql_statement]\n"; ^D executing [select * from users where name like '%kabel%'] C:\Perl Testskripte\580>
or use the qq operator:
C:\Perl Testskripte\580>perl use strict; my $name = "kabel"; my $sql_statement = qq~select * from users where name like '%$name%'~; print "executing [$sql_statement]\n"; ^D executing [select * from users where name like '%kabel%'] C:\Perl Testskripte\580>
or just escape the " characters: \"


Comment on Re: MySQL Select problem
Select or Download Code
Re: Re: MySQL Select problem
by Anonymous Monk on Oct 09, 2002 at 15:13 UTC
    It's not working anyway.
      the only code piece you posted had this quoting error. you should post more code because the error definitively is in another code snippet. post more code and a monk will know the answer. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://203943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-12-21 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls