PDO::ERRMODE_EXCEPTION )); } catch (Exception $e) { die("Error : ".$e->getMessage()); } $req = $db->prepare('SELECT id FROM `authors` WHERE username=:username'); $req->execute(array( "username"=>$_SESSION['username'] )); $data = $req->fetch(); $user_id = $data['id']; $req = $db->prepare('SELECT message_by, COUNT(message_by) AS n_msg FROM `messages` WHERE message_to=:user_id AND message_read=0'); $req->execute(array( "user_id"=>$user_id )); $result = $req->fetchAll(); ?> Discussion | Chiro - Canto

Discussion

New messages

Send a message