devan Posted November 22, 2011 Share Posted November 22, 2011 I want to have a search product feature, but I would like members to be able to search multiple fields in one go i.e. product_code, Product_name in one MySQL query. The thing is, members have to be logged on, so the query must also only show results relating to that specific member, via the session[member_ID], my current query for listing products for that specific member is : $sql = "SELECT productId, productCode, image, name, price, stock_level FROM product_inventory WHERE memberr_ID = '" . $_SESSION['SESS_mem_ID'] . "; How would I change the above into a search query to search for productcode, productname and still only show results beloging to this member using the session data ? all help appreciated Quote Link to comment Share on other sites More sharing options...
sunfighter Posted November 22, 2011 Share Posted November 22, 2011 It can't be this easy, I must have missed something. Your code: $sql = "SELECT productCode, name FROM product_inventory WHERE memberr_ID = '" . $_SESSION['SESS_mem_ID'] . "; You might have to change how this is displayed. Don't know, that code was not supplied. Give it a go. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.