<?php

			session_start();
			include('database.php');
			DB_connexion(); 

			$query = "SELECT destinataires FROM tchat";
			$result = mysql_query($query);
			
			$findme = "titi";
			$cpt = 0;
			$n = 0;
			while($infos = mysql_fetch_array($result)) 
			{
				$pos = strpos( $infos['destinataires'], $findme);
				if($pos !== false)
				{
					$n = $n + 1;
				}
				
			}


			echo $n;
			
			// si $n > variable session 
			// flag_beep = true pour la notification lors du rafraichissement de la page
			
?>