Questo è il tuo codice corretto... l'errore era dato dalla prima graffa che aprivi.. che era di troppo... nota anke i due commenti che ti ho messo
	Codice PHP:
	
$linea=$_GET[linea];
$prodotto=$_GET[prodotto];
if ($linea==NULL) //tu avevi scritt $linea=null RICORDA CHE $a=1 è un assegnamento, per fare il confronto sono 2 gli uguali da usare 
{
    $result= mysql_query ("SELECT * from commerciale where categoria='$prodotto'") or die('query non eseguita') ; 
        while ($query = mysql_fetch_array($result)) 
        {
            echo "$query[linea]
$query[categoria]
$query[text]"; 
        }
    if ($prodotto==NULL) //cme sopra
    {
            $result= mysql_query ("SELECT * from commerciale where linea='$linea'") or die('query non eseguita') ; 
                    while ($query = mysql_fetch_array($result)) 
                    {
                        echo "$query[linea]
$query[categoria]
$query[text]"; 
                    }
    }
    else 
    {
        $result= mysql_query ("SELECT * from commerciale where categoria='$prodotto' AND linea='$linea'") or die('query non eseguita') ; 
            while ($query = mysql_fetch_array($result)) 
            {
                echo "$query[linea]
$query[categoria]
$query[text]"; 
            }
    }
} 
 
 