You guys probably don’t understand my question, I’ll try to explain further.
I have a site that displays the product information its name, id, price, quantity etc.
Now I have displayed it in a way of using $_GET variable.
Like for example if I want to click the product page then the link would be
http://localhost/InventorySystem/Employee/Tools/?Item=ProductList
I dont have to make another php page for that all I need is a get method and it will display the product information.
Now my problem is, How to I implement a search function with it? Is there a way for me to create a search function like
?Item=ProductList&Search=SearchTerm
I having a hard time how to do it. Please any advices.
basically add another variable in your query string, like you just showed in your example:
?Item=ProductList&Search=SearchTerm. and just do$_GET['Search']to get the value, pass it to your mysql and implement a filter using theWHEREclause compounded withLIKElike so:This will return results containing the term you passed in
$searchkey, e.g. if$searchkey = "ball"thenvolleyball, basketball, baller, basketballvolleyare all valid matches.EDIT:
Your html form should look something like this to be able to pass your required params in your query string: