Hello when i am searching a product from its keywords that i inserted in MYSQL all the products are appearing please help me this is the code of the search i corrected as in the
Your form is not properly structured - the "user_query" field is outside of the form so $_GET['user_query']
would never be set. Try changing this:
To something like this:
Also, as several others have noted, this is susceptible to SQL injection. This post discusses a scenario very similar to yours: How can I prevent SQL injection in PHP?
I strongly suggest you run your generated code through a validation service in order to catch errors in your html. Be sure to use the generated html (copy from "view source" in browser), not just the code from your php file because the validator won't understand the PHP. The WWW Consortium has a good tool: http://validator.w3.org/#validate_by_input