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) 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 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
Archived
This topic is now archived and is closed to further replies.