I need some help on a project I am working on. I am trying to make a 'simple' message system.
There is most likely a silly stupid little bug, but I cannot find it thanks in advance and here is my code:
<?
session_start();
require_once('connect.php');
$name = $_SESSION['name'];
$q = "SELECT * FROM pm WHERE to = '$name'";
$r = mysqli_query($link,$q);
if(mysqli_num_rows($r)>0) {
while($row = mysqli_fetch_array($r,MYSQLI_ASSOC)){
echo $row['to'];
echo $row['from'];
echo $row['message'];
}
}
?>