Jump to content

Archived

This topic is now archived and is closed to further replies.

bach

ConCat help

Recommended Posts

I have the following SELECT statement
[code]SELECT s_name, s_firstname, CONCAT_WS('-', LEFT(s_phone, 4), MID(s_phone, 5, 3), RIGHT(s_phone, 4))
FROM `bridgend`.`sam`
ORDER BY s_name asc;[/code]

When displaying s_phone nothing is displayed on the my site.  s_name and s_firstname is displayed would I somehow have to put concat_ws in a temp variable so I can display it on my site.

Regards

Share this post


Link to post
Share on other sites
I'm not sure what you getting at... if you display s_phone, no concat, do you get the expected output (minus formatting)?

Share this post


Link to post
Share on other sites
yes if I display s_phone I get the data but not in the format, so my queryis how do I get the format out of the query ??

Share this post


Link to post
Share on other sites
Put an alias on the column
eg:
[code]
SELECT ..., CONCAT(....) AS phone_frmt
echo $row['phone_frmt'];
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.