forumnz Posted February 3, 2008 Share Posted February 3, 2008 This: <?php $cuisines = "AND (c1 LIKE '%$cuis%' OR c2 LIKE '%$cuis%' OR c3 LIKE '%$cuis%' OR c4 LIKE '%$cuis%' OR c5 LIKE '%$cuis%')"; ?> Gives this error: Warning: Unexpected character in input: '\' (ASCII=91) state=1 in /usr/local/www/vhosts/site/httpdocs/Browse/index.php on line 419 What do I need to do? Thanks, Sam. Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/ Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 Can you echo your entire query and show us? Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457115 Share on other sites More sharing options...
forumnz Posted February 3, 2008 Author Share Posted February 3, 2008 <?php if($cuis != '' && $cuis != '0')\ { $cuisines = "AND (c1 LIKE '%$cuis%' OR c2 LIKE '%$cuis%' OR c3 LIKE '%$cuis%' OR c4 LIKE '%$cuis%' OR c5 LIKE '%$cuis%')"; } $query = "SELECT count(*) FROM fflists WHERE $op='$trim' AND (keywords LIKE '%$key%' OR business_name LIKE '%$key%') $cuisines AND active='1'"; ?> Is that right? Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457116 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 Now... echo $query; and show us. Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457117 Share on other sites More sharing options...
forumnz Posted February 3, 2008 Author Share Posted February 3, 2008 SELECT count(*) FROM fflists WHERE oid='0' AND (keywords LIKE '%%' OR business_name LIKE '%%') AND active='1' Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457128 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 Sorry, I was looking for n sql error. Its a php error (having a shocker today). Can wee see 10-15 lines prior to and including line 419. Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457136 Share on other sites More sharing options...
forumnz Posted February 3, 2008 Author Share Posted February 3, 2008 I think this is the one you want: $cuis = trim($cuisine); Link to comment https://forums.phpfreaks.com/topic/89272-unexpected-character-in-input/#findComment-457148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.