I'm using the following code to update a MySQL database:
while ($row = mysql_fetch_array($sql_result)) {
$Field1 = $row["Field1"];
$Sequence = $row["Sequence"];
$Field1 = str_replace("Replace this", "With this", $Field1);
mysql_query("UPDATE Requests
SET Field1 = $Field1
WHERE Sequence = $Sequence");
Print $Field1 ?> <BR> <? Print $Sequence ?> <BR><BR> <?;
}
If the "Replace this" and "With this" parts of the str_replace function are numeric,
$Field1 = str_replace("123", "456", $Field1);
this code works fine and the fields in the MySQL database are updated.
If the "Replace this" and "With this" parts of the str_replace function are text, the $Field1 strings printed to the browser are updated, but the MySQL database is not.
Any ideas?
Thanks!
Timm