Salve a tutti, sto procedendo al trasferimento del sito web dell'azienda presso cui lavoro su un nuovo host e sto avendo molti problemi nel configurare un file php e mysql per la sezione del sito relativa alle certificazioni.
Ho dei problemi nel passaggio dei dati da un .csv alle tabelle mysql....visto che il php non è stato creato da me, ho dei problemi a capirne il funzionamento, qualcuno di voi potrebbe spiegarmi cosa fa il pezzo di codice successivo???

[PHP]

$norma = $arr2[9];
$sql = "SELECT id FROM tcert WHERE nome='$norma' LIMIT 0,1";
$res = mysql_query($sql);
$num = mysql_num_rows($res);
if($num > 0) {
list($idNorma) = mysql_fetch_array($res);
} else {
$sql = "INSERT INTO tcert (nome) VALUES ('$norma')";
$res = mysql_query($sql);
$sql = "SELECT id FROM tcert WHERE nome='$norma' LIMIT 0,1";
$res = mysql_query($sql);
list($idNorma) = mysql_fetch_array($res);
}
$arr2[9] = $idNorma;

$ea1 = $arr2[10];
$sql = "SELECT id FROM sett WHERE nome='$ea1' LIMIT 0,1";
$res = mysql_query($sql);
$num = mysql_num_rows($res);