function fullname($id){
$query = mysql_query("SELECT firstname, lastname FROM users WHERE id = '$id'");
$row = mysql_fetch_array($query);
$full_name = $row["firstname"] . " ".$row["lastname"];
return $full_name;
}
I want to grab firstname and lastname, put them together, and then echo it back, is this right?
if id field is an integer you do not have to use like ‘id’
this is the correct line of code