<?
include ('logue.php');
include ('entete2.php');


$req = "SELECT * FROM matgraph_users WHERE login = 'oneill'";
$res = mysql_query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$num = mysql_num_rows($res);

$cond = "( 0";

while( $row = mysql_fetch_array($res) ) {
	$cond = $cond." OR msg like '%[".$row[galaxi].":".$row[system].":".$row[position]."]%'";
}

$cond = $cond." ) AND sujet like '%ressource%'";



$req = "SELECT * FROM matgraph_msg WHERE $cond UNION SELECT * FROM matgraph_msg_log WHERE $cond ORDER BY id DESC";
$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) ) {

		echo "<br> Id : $row[id]<br>Date : $row[date]<br>Message : $row[msg] <br>";

		if( $row[date] < "2005-12-18 00:00:00" ) {
			break;
		}
	}
}




?>