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 Quote Link to comment 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)? Quote Link to comment 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 ?? Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.