I am writing a very simple function in which I grab the id from one table and need to pull in the information from it from another table. I am sure this is simple I am just confusing myself.
I need to be able to return 2 variables and not sure how to do that with one argument going in.
Example:
function getMyInfo($id)
{
$query = "SELECT * FROM info WHERE id = '$id'";
$result....
$fname = $row['fname'];
$lname = $row['lname'];
return $fname;
return $lname;
}
Now how do I call that so I can use those variable separately outside the function?
$my_fname = getMyInfo();
$my_lname = getMyInfo();
Not sure how to call them. Any explanation would be appreciated!
Thanks.