Can anyone tell me if I am going in the wright direction with this, or if there is a better way, I am trying to create a session check so that if logged in clients change the url id number
example.com?id=192
it won't show other clients contents. Its the first time having to write a cms with multiple mysql table checks so the query is probably wrong as well.
$id= mysql_real_escape_string($row['id']);
$user_id= mysql_real_escape_string($row['user_id']);
$username = mysql_real_escape_string($_SESSION['username']);
$who = mysql_query("SELECT u.id, u.username FROM users u INNER JOIN profile p WHERE username='$username' AND user_id='$id'");
$who_num_rows = mysql_num_rows($who);
if (!$username&&$id==$user_id)
Runn valid page content.
else
{
Runn error.
}