john_6767 Posted August 18, 2006 Share Posted August 18, 2006 i have a database that has " in some of the names of the fields and i am trying to write some sql to update these fields by replacing " with the word 'inch'. How would i go about doing this? php is having trouble with the "... Link to comment https://forums.phpfreaks.com/topic/17916-help-with-update-query/ Share on other sites More sharing options...
AndyB Posted August 18, 2006 Share Posted August 18, 2006 In the names of the fields, or the data in the fields?Trivial example below works:[code]<?php$old = 'This is a six" nail';$new = str_replace('"',' inch',$old);echo $new;?>[/code] Link to comment https://forums.phpfreaks.com/topic/17916-help-with-update-query/#findComment-76691 Share on other sites More sharing options...
fenway Posted August 18, 2006 Share Posted August 18, 2006 MySQL has a replace function as well. Link to comment https://forums.phpfreaks.com/topic/17916-help-with-update-query/#findComment-76822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.