Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Anna Takang Nchongarrey-Oben
Anna Takang Nchongarrey-Oben
7,365 Points

Select the "first_name" concatenated with the username in parentheses and alias it as "display_name". For example "Andre

Select the "first_name" concatenated with the username in parentheses and alias it as "display_name". For example "Andrew (chalkers)". Note that there's a space between the end of the first_name and username in parentheses. The name of the table is "users".

2 Answers

If you're in mysql, you'll need to use the CONCAT function:

SELECT CONCAT(first_name, ' (', username,  ')') as display_name from users

This should give you what you want :)

Nick Davies
Nick Davies
7,972 Points

You use the . to concatenate in php.