<?php

session_start();
include 'config.php';

$user   =   $_SESSION['usuario'];

$select = "select count(*) from chat where leido=0 and (ip_dest='$user' or ip_dest='*')";

mysqli_query($con ,$select,$conex);

$resultado = mysqli_query($con ,$select,$conex);

echo mysqli_result($resultado, 0);
?>