KyleVA Posted September 14, 2009 Share Posted September 14, 2009 Alright - for one of the columns in a specific table all of the data is formatted the same way (ex. Text - More Text) I'm trying to find a way to make it so that it will select only 'More Text' from that, meaning everything after the '- '. $sql = "SELECT code,prompt,price FROM s01_Options WHERE product_id='".mysql_escape_string($prodid)."' AND code like '%".mysql_escape_string($optionSelect)."%' AND prompt like '".mysql_escape_string($secondChoice)."%'"; } $res = mysql_query($sql); $options = ""; while($row=mysql_fetch_assoc($res)) { $options.= "<option AttribCost='{$row["price"]}' RegPrice='' value='{$row["code"]}'> {$row["prompt"]} - "."$"."{$row["price"]}</option>"; } The prompt column is the one that has data formatted like so 'Text1 - More Text Here', just trying to find a way to trim it down so only 'More Text Here' will be returned without the 'Text 1 - '. Link to comment https://forums.phpfreaks.com/topic/174248-modifying-contents/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.