zelig Posted April 20, 2012 Share Posted April 20, 2012 Okay, I have a question. Is there a way to combine three fields within a single table (x, y, z) into a single variable? Something like: x~y~z? (the ~ would be needed) Quote Link to comment https://forums.phpfreaks.com/topic/261338-combine-3-fields-into-a-single-output/ Share on other sites More sharing options...
marcus Posted April 20, 2012 Share Posted April 20, 2012 SELECT CONCAT_WS('~',x,y,z) AS xyz FROM table CONCAT_WS is a mysql function for concatenating fields with a separator. So when you execute your query you would be able to use $row['xyz'] as x~y~z Quote Link to comment https://forums.phpfreaks.com/topic/261338-combine-3-fields-into-a-single-output/#findComment-1339199 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.