<?php
// Ajout d'une colonne division dans la table ".$prefix."_freq
$freqdiv_alter = "ALTER TABLE ".$prefix."_freq ADD division TEXT NOT NULL";
mysqli_query($bdd,$freqdiv_alter);
// Transfert des divisions des élèves dans cette nouvelle colonne
$freq_select = "SELECT * FROM ".$prefix."_freq freq
INNER JOIN ".$prefix."_eleves eleves
ON freq.eleves_id = eleves.eleves_id";
$freq = mysqli_query($bdd,$freq_select);
$freq_nb = mysqli_num_rows($freq);
if($freq_nb!=0) {
	while($freq_info=mysqli_fetch_assoc($freq)) {
		$freq_update="UPDATE ".$prefix."_freq SET division = '".$freq_info['division']."' WHERE freq_id = ".$freq_info['freq_id']."";
		mysqli_query($bdd,$freq_update);
	}
}
// version bdd :
$versbdd_up = "UPDATE ".$prefix."_parametres SET valeur = '0.13' WHERE param_nom = 'version_bdd'";
mysqli_query($bdd,$versbdd_up);
?>