I have a string in a database like this:
<br><font size="4" color="#FF0000">OUT OF STOCK</font><br> miniatures Golden Hair Cherub Collection 3" <b>4 asst,</b> price is for the dozen
and others like this:
<br><font size="4" color="#FF0000">GONE</font><br> miniatures Golden Hair Cherub Collection 3" <b>4 asst,</b> price is for the dozen
I want to replace the first part from both of them so it just reads:
miniatures Golden Hair Cherub Collection 3" <b>4 asst,</b> price is for the dozen
and update the database with that. I have tried the following:
$query = "select * from storeProduct where productID = '$name'";
$mysql_result = mysql_query($query, $mysql_link);
$row = mysql_fetch_row($mysql_result);
$cut = ereg_replace("<br><font size=\"4\" color=\"#FF0000\">OUT OF STOCK</font><br> ", "", $row[3]);
//This is inside of a while statement so it will come back around again and I want to pull out the ones that have 'GONE' in them as well and update the database accordingly.
//it works fine except for when I try to do both I was trying it like this:
//$cut = ereg_replace("<br><font size=\"4\" color=\"#FF0000\">GONE</font><br> ", "", $row[3]);
//and hoping that $cut the second time would pick up the ones that the first $cut didn't. Doesn't quite work like this.
$update = "update storeProduct set productDescription = '$cut' where productID = '$name'";
$update_result = mysql_query($update, $mysql_link);