Im a Beginner in PHP learning the basic by watching a video. We in the process of creating a form. I understood everything that is happening except for the below. Can someone please explain to me why he did it like this, rather than ---> id='$_SESSION['user_id']";
id='"'.$_SESSION['user_id']."'";
function getuserfield($field){
$query = "SELECT $field FROM users WHERE id='".$_SESSION['user_id']."'";
$query_run = mysql_query($query);
if($query_run){
return mysql_result($query_run, 0, $field);
}
}