<?php
include('config.php');

// multi ou pas multi, tel est la question O_o

$req = "SELECT id FROM matgraph_multi WHERE ((alerte_multi*2 + connection_multi) > 3) AND ((envoi1 + envoi2) > 0)";
$res = mysql_query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);
if ( $num > 0 ) {
	While ( $row = mysql_fetch_array($res) ) {
		$req2 = "SELECT * FROM matgraph_multiencours WHERE idmulti=$row[id] limit 1";
		$res2 = mysql_query($req2) or die('Erreur SQL! <br>'.$req2.'<br>'.mysql_error());
		$num2 = mysql_num_rows($res2);
		if ( $num2 == 0 ) {
			$requete = "INSERT INTO matgraph_multiencours VALUES ('', '$row[id]')";
			$resultat = mysql_query($requete)or die('erreur sql<br>'.$requete.'<br>'.mysql_error());
		}
	}
}

echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("multi_comptes.php");
-->
</script>';




?>