我需要在php mysql查询中删除所有双引号,单引号,所以我会在查询中使用REPLACE()
但没有任何更改或结果。
以下查询:
$strSql = "select RW.review_channelid,RW.review_id,RW.create_date,RW.rating_overall,RW.isold,RW.guestreplysent,RW.guest_id,RW.guest_name,REPLACE(RW.review_title,'\"','') as review_title,RW.channel_id,RW.review_type,RW.review_method,RW.your_view,RW.neg_review,CH.extranet_url,RW.checkout_date,RW.review_time,CH.channel_code,CH.channel_name,RW.isposted_facebook,RW.isposted_twitter,IF(RW.review_time ='0000-00-00',create_date,review_time) AS rtime
from ".dbtable::ReviewMaster." AS RW
left join ".dbtable::ChannelMaster." AS CH ON RW.channel_id = CH.channel_id
where prop_code = '".$_SESSION['AdminDetails']['prop_code']."' ";
我想替换或删除PHP REPLACE(RW.review_title,'\"','')
中字符串中间的双引号,用于mysql查询中的review_title
任何有任何想法的机构请帮忙解决。感谢
答案 0 :(得分:0)
replace(replace(RW.review_title,'"',""),''',"")
> $strSql = "select
> RW.review_channelid,RW.review_id,RW.create_date,RW.rating_overall,RW.isold,RW.guestreplysent,RW.guest_id,RW.guest_name,replace(replace(RW.review_title,'"',""),''',""),'\"','')
> as
> review_title,RW.channel_id,RW.review_type,RW.review_method,RW.your_view,RW.neg_review,CH.extranet_url,RW.checkout_date,RW.review_time,CH.channel_code,CH.channel_name,RW.isposted_facebook,RW.isposted_twitter,IF(RW.review_time
> ='0000-00-00',create_date,review_time) AS rtime
> from ".dbtable::ReviewMaster." AS RW
> left join ".dbtable::ChannelMaster." AS CH ON RW.channel_id = CH.channel_id
> where prop_code = '".$_SESSION['AdminDetails']['prop_code']."' ";
答案 1 :(得分:0)
$strSql = "select RW.review_channelid,RW.review_id,RW.create_date,RW.rating_overall,RW.isold,RW.guestreplysent,RW.guest_id,RW.guest_name,REPLACE(RW.review_title,'"','') as review_title,RW.channel_id,RW.review_type,RW.review_method,REPLACE(RW.your_view,'"','') as your_view,REPLACE(RW.neg_review,'"','') as neg_review,CH.extranet_url,RW.checkout_date,RW.review_time,CH.channel_code,CH.channel_name,RW.isposted_facebook,RW.isposted_twitter,IF(RW.review_time ='0000-00-00',create_date,review_time) AS rtime
from ".dbtable::ReviewMaster." AS RW
left join ".dbtable::ChannelMaster." AS CH ON RW.channel_id = CH.channel_id
where prop_code = '".$_SESSION['AdminDetails']['prop_code']."' ";