So I have the below query, on query 2 I want to drop anything that is equal to $this_post_cat_id. Can anyone help, very new to SQL
$query = "SELECT * FROM categories WHERE cat_id = '$this_post_cat_id'
$query2 = "SELECT * FROM categories";
>Solution :
You can use either <> or != for not equal;
$query2 = "SELECT * FROM categories WHERE catid != '$this_post_cat_id'";
Or
$query2 = "SELECT * FROM categories WHERE catid <> '$this_post_cat_id'";