This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

problem in sql

function get_unique_categories(){ global $con; if(isset($_GET['category'])){ $category_id=$_GET['category']; $select_query="Select * from `products` where category_id='$category_id'"; $result_query=mysqli_query($con,$select_query);

Answer Answered by Daniel Black in this comment.

There isn't enough information here to say what the error is.

Also use prepared statements to avoid SQL injection.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.