I'm not going to answer your question but since you say: "I'm not very good with php coding" I'm taking the liberty to give you some advice about getting organized. You have a statement:
$sql = mysql_query("SELECT * FROM products ORDER BY category DESC");
SQL is the acronym for "Structured Query Language." The function 'mysql_query()' is not going to return a 'Structured Query Language' but a result. In fact, the parameters you feed to the function 'mysql_query()' is written in 'Structured Query Language' ("SELECT * FROM products ORDER BY category DESC"). To better reflect this reality it would be better to write:
$sql = "SELECT *
ORDER BY category
$result = mysql_query($sql) OR die(mysql_error());
Now $sql contains Structured Query Language while $result contains the result returned by the SQL.
Further, MySQL is going to be deprecated. It's a good idea to upgrade to mysqli. See http://php.net/manual/en/function.mysql-error.php