Ragazzi scusate il disturbo, risolto, dovevo usare UNION, ma non come facevo io...
GrazieCodice PHP:
if($codice!=""){
$sql = "SELECT * FROM xxx WHERE codice=$codice UNION SELECT * FROM xxx2 WHERE codice=".$codice;
}else{
$sql = "SELECT * FROM xxx WHERE id=$id UNION SELECT * FROM xxx2 WHERE id=".$id;
Scusate il disturbo...