Plus, if you are accessing $_SESSION, then you need session_start() at the top of the script.
Also errors in the query
You are trying to match the value in column myid with the string value 'myid'
You are trying to order the results by the string value 'id'
Of course it showed TVs in each category - that's what you selected. Why is that wrong?
- - -
I would advise you add a category table and store the catgory id in the product records and not repeat the name in every product of that type.
+-------------+ +-----------------+
| product | | category |
+-------------+ +-----------------+
| id | +----| id |
| name | | | cat_name |
| cat_id |>--+ | cat_image |
| code | | cat_price |
| price | +-----------------+
| image |
+-------------+
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.