<?php
$select = mysql_query ("SELECT name FROM `phpmylogon` WHERE id = '".$_SESSION['user_id']."'") or die (mysql_error()); //selecteer naam van gebruiker
$data = mysql_fetch_assoc($select);
$sql = mysql_query("SELECT * FROM pm_system WHERE naar_gebruiker = '".$data['name']."'") or die(mysql_error()); //selecteer gegevens van gebruiker
$sql1 = mysql_query("SELECT * FROM pm_system WHERE gelezen = 0") or die(mysql_error());
$aantal = mysql_num_rows($sql1); //selecteer ongelezen berichten
<?php
$select=mysql_query("SELECT name FROM `phpmylogon` WHERE id = '".$_SESSION['user_id']."'") or die(mysql_error());//selecteer naam van gebruiker