unkwntech Posted July 27, 2008 Share Posted July 27, 2008 This query: SELECT productName, productDesc, productPrice FROM products WHERE productDesc LIKE %1%2%3% OR color LIKE %1% OR size LIKE %1% OR color LIKE %2% OR size LIKE %2% OR color LIKE %3% OR size LIKE %3% is producing this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%1%2%3% OR color LIKE %1% OR size LIKE %1% OR color LIKE %2% OR size LIKE %2% OR' at line 1 Any help? Link to comment https://forums.phpfreaks.com/topic/116874-query-not-working/ Share on other sites More sharing options...
br0ken Posted July 27, 2008 Share Posted July 27, 2008 You need single brackets round the %1%2 parts. colour LIKE '%1%2' etc Link to comment https://forums.phpfreaks.com/topic/116874-query-not-working/#findComment-601156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.