Using php variable inside a query

Posted by Aruna on Stack Overflow See other posts from Stack Overflow or by Aruna
Published on 2010-03-08T08:47:01Z Indexed on 2010/03/08 8:51 UTC
Read the original article Hit count: 190

Filed under:

Hi,

i am using a query inside php as

 $query =  'SELECT * from #__chronoforms_UploadAuthor where text_6 like "%'.$_GET['title'].'%" and text_7 like "%'.$_GET['author'].'%" limit 0,1';

where i am trying to insert a php variable instead of 1 in the limit..

   $query =  'SELECT * from #__chronoforms_UploadAuthor where text_6 like "%'.$_GET['title'].'%" and text_7 like "%'.$_GET['author'].'%" limit 0,"'.$_GET['limit'].'"';

but it shows me the error . Pls help me .. THere are some errors in keeping $_GET['limit']..

© Stack Overflow or respective owner

Related posts about php5