Waza04 Posted March 17, 2003 Share Posted March 17, 2003 Hiya All, Can somebody please tell me what is wrong with these two data quireies... $quickie_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_upc = '" . $HTTP_POST_VARS['quickie'] . "' or products_model '" . $HTTP_GET_VARS['quickie'] . "'"); And this one: $quickie_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_model LIKE '%" . $HTTP_POST_VARS['quickie'] . "%' or and products_upc LIKE '%" . $HTTP_POST_VARS['quickie'] . "%'"); Thanks You Very Much!! Warren Link to comment Share on other sites More sharing options...
greree Posted March 18, 2003 Share Posted March 18, 2003 I don't know anything about MySQL, but I just read a query in my cart, and yours looks like it would go like this: $quickie_query = tep_db_query("select products_id from products where products_upc = '" . $HTTP_POST_VARS['quickie'] . "' or products_model '" . $HTTP_GET_VARS['quickie'] . "'"); and $quickie_query = tep_db_query("select products_id from products where products_model LIKE '%" . $HTTP_POST_VARS['quickie'] . "%' or and products_upc LIKE '%" . $HTTP_POST_VARS['quickie'] . "%'"); Or maybe your way is valid also. I'm not too familiar with MySQL. Link to comment Share on other sites More sharing options...
Waza04 Posted March 18, 2003 Author Share Posted March 18, 2003 Thanks fr your reply - but that dont work!! I get: MYSQL QUERY ERROR REPORT --------------------------------------- 1064 - You have an error in your SQL syntax near '''' at line 1 select products_id from products where products_upc = 'DVD-REDCupc' or products_model '' Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.