1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<?php
$host = "localhost";
$user = "user";
$bdd = "bdd";
$passwd = "mdp";
mysql_connect($host, $user,$passwd) or die("erreur de connexion au serveur");
mysql_select_db($bdd) or die("erreur de connexion a la base de donnees");
$fp = fopen('monfichier.dat');
while (!feof($fp))
{
$ligne = fgets($fp);
$file[i] = explode("\t", $ligne);
}
$sql = 'SELECT mac, ip, epoch, texte FROM enregistrement';
$req = mysql_query($sql);
while ($data = mysql_fetch_array($req))
{
if ($data['mac'] != $file[$i][0] || $data['ip'] != $file[$i][1] || $data['epoch'] != $file[$i][2] || $data['texte'] != $file[$i][3] )
echo 'Pas identique';
else{
echo 'identique';
}
}
?> |
Partager