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: \"

Replies are listed 'Best First'.
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. :)