Re: can someone check my sql syntax please?!
by "Mukesh Wani" <mukeshwani(at)hotmail.com>
|
Date: |
Wed, 31 May 2000 15:27:07 GMT |
To: |
sue(at)bartandsue.co.uk, hwg-languages(at)hwg.org |
|
todo: View
Thread,
Original
|
|
Try putting "%" signs in the WHERE Clause.
> $searchStmt .= "long_desc LIKE '%$search_word[$i]%' ";
--Mukesh
>Hi. Can someone have a look at this and see if they can see what the syntax
>error is, because my eyes are crossing from looking at it!
>
>Cheers,
>
>Sue
>
>$searchStmt = "SELECT * from $tableName WHERE ";
>
>---snip some other bits that work fine! ---
>
> if(isset($search_word)){
> for($i = 0; $i < count($search_word); $i++) {
> $searchStmt .= "long_desc LIKE '$search_word[$i]' ";
> if ($i < count($search_word) -1)
> {$searchStmt .= " AND ";
> }
> }
> }
>
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA