PHP: make a function

alexwork

New Member
\[code\]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;}\[/code\]I want to grab firstname and lastname, put them together, and then echo it back, is this right?
 
Back
Top