bach Posted October 19, 2006 Share Posted October 19, 2006 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 Link to comment https://forums.phpfreaks.com/topic/24494-concat-help/ Share on other sites More sharing options...
fenway Posted October 19, 2006 Share Posted October 19, 2006 I'm not sure what you getting at... if you display s_phone, no concat, do you get the expected output (minus formatting)? Link to comment https://forums.phpfreaks.com/topic/24494-concat-help/#findComment-111578 Share on other sites More sharing options...
bach Posted October 20, 2006 Author Share Posted October 20, 2006 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 ?? Link to comment https://forums.phpfreaks.com/topic/24494-concat-help/#findComment-111795 Share on other sites More sharing options...
shoz Posted October 20, 2006 Share Posted October 20, 2006 Put an alias on the columneg:[code]SELECT ..., CONCAT(....) AS phone_frmtecho $row['phone_frmt'];[/code] Link to comment https://forums.phpfreaks.com/topic/24494-concat-help/#findComment-111803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.