Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 rifling through the Monastery: (16)
As of 2014-10-24 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (134 votes), past polls