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 '##' Quote 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']); } Quote 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); Quote Link to comment https://forums.phpfreaks.com/topic/166153-substring/#findComment-876279 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.