$sql_1 = mysql_query(...) or trigger_error(mysql_error());
^^^^^^^^^^^^^^^^^^^^^^--- bare mininum handling
$sql_1=mysql_query("SELECT * FROM category WHERE tier='2' parent='$p_id' ORDER BY id ASC");
^-- missing ' AND '
If you had proper error handling in your code, you've have seen this:
Thanks for the quick responce. I am new to all this and i lack a lot of knowledge, i will try to keep that in my mind
You've got an SQL syntax error: