comprueba por separado cada una de las acciones:
Cita: $where = array();
if( $provincia != 0 )
{
$where[] = "provincia='$provincia'";
}
print_r(where);
if( $categoria != 0 )
{
$where[] = "categoria ='$categoria'";
}
print_r(where);
if( !empty($where) )
{
$where_sql = implode(' AND ', $where);
}
echo $whrere_sql;