Quote:
Originally Posted by k0nr4d
Your description is still incredibly confusing, but there is no other replace query in mysql.
You can do this with php
Code:
$replace = array("cat","dog","fish");
$with = "zombie";
$result = mysqli_query($dblink,"SELECT animal,id FROM pets");
while($row = mysqli_fetch_assoc($result)) {
$row['animal'] = mysqli_real_escape_string($dblink,stri_replace($replace,$with,$row['animal']));
mysqli_query($dblink,"UPDATE pets SET animal = '".$row['animal']."' WHERE record_num = '".$row['id']."'");
}
|
Okay, guess I need to write out all the different values to replace in $replace = array
Thank you for the help, I appreciate it
