sandy1028 Posted July 16, 2009 Share Posted July 16, 2009 There is field called "text" and it is concatenated with the delimiter '##'. How to select all the values before the delimiter '##' And How to select all the values after the delimiter '##' Link to comment https://forums.phpfreaks.com/topic/166153-substring/ Share on other sites More sharing options...
Amtran Posted July 16, 2009 Share Posted July 16, 2009 <?php $query = "SELECT * FROM some_database"; $result = mysql_query($query); while ($row = mysql_fetch_array($result) { $resultArray1 = explode('##', $row['somerow']); $resultArray2 = explode('##', $row['somerow']); } Link to comment https://forums.phpfreaks.com/topic/166153-substring/#findComment-876267 Share on other sites More sharing options...
trq Posted July 16, 2009 Share Posted July 16, 2009 before SELECT SUBSTRING_INDEX(`text`, '##', 1); after SELECT SUBSTRING_INDEX(`text`, '##', -1); Link to comment https://forums.phpfreaks.com/topic/166153-substring/#findComment-876279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.