In message <[EMAIL PROTECTED]>, Mike Brandonisio <[EMAIL PROTECTED]> writes >Hi, > >I'm having a syntax problem when trying to use the wild card '%' in >my query. Here is my code > >$query = 'SELECT * > FROM `memberDirectory` > WHERE `business_name` LIKE ''%'.$_POST['business_name'].'%'' OR > `address` LIKE ''%'.$_POST['address'].'%'' OR > `suite` LIKE ''%'.$_POST['suite'].'%'' OR > `city` LIKE ''%'.$_POST['city'].'%'' OR > `cat1` LIKE ''%'.$_POST['category'].'%'' OR > `cat2` LIKE ''%'.$_POST['category'].'%'' OR > `cat3` LIKE ''%'.$_POST['category'].'%'' > ORDER BY `business_name`'; > >I do not show it here but I do a 'htmlspecialchars(trim()) on the >$_POST vars earlier in the script. However the error I'm getting is >on the line with that starts 'WHERE' and the error reads: > >Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in / >home/paloscha/public_html/result.php on line 29 > >Can someone maybe point me in a direction.
echo $query before executing the query. Bet it's obvious! (It isn't obvious from the above) And I hope that your visitors have plenty of time to wait, because that query looks as though it will take ages to run. -- Pete Clark http://www.hotcosta.com http://www.spanishholidaybookings.com The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
