I have a database that has a users first and last name. Some cases i display the users full name, but in other cases i just show the first name. i have a function that gathers user information.
within the function, i use an sql query to gather the first and last name, but i also concat the first and last name and label it full_name.
Example..
$q = "SELECT first_name, last_name, CONCAT_WS(' '. first_name, last_name) AS full_name
/* A lot of other information */
FROM users WHERE user_id=$user_id";
My question is, is this too much, is it unnecessary to get the same data in different forms straight out of the database, or would it be better to just take the first and last name from the database and then concat afterward in php like so...
echo $user['first_name'].' '.$user['last_name'];