PHP MYSQL update - replace whole word, but not part of it

Wednesday, November 4, 2015

Lets say the field name is bla and the value 123



When I do:



mysqli_query($con, "UPDATE table SET bla = REPLACE (bla, 123, 777)");


123 becomes 777 and it's good



But when I do:



mysqli_query($con, "UPDATE table SET bla = REPLACE (bla, 1, 777)");


I DON'T want 123 to become 77723 but stay 123



How can I do that?

0 comments:

Post a Comment