特定字符组合乱码问题,纠结!!

浮躁的码农 发布于 2015/05/15 11:32
阅读 66
收藏 0

今天遇到个奇怪的问题,后台的sql字符串数据库里的字符保存正常,但取出来放到前台的时候就乱码了。

原始sql:

SELECT
        monitor_date,
        concat(c_cityname,'-',c_netservicename) as city_netservice,
        jacking,
       concat(
        '<A href="/repShow/lookReport?reportId=de747fe6904d4d5da2f243ad9b42082f&cityname=',c_cityname, '&currentPage=1&netservicename=',c_netservicename,'&fromDate=',monitor_date,' "target="_blank"> [详情2]  </A>',
        '<A href="/repShow/lookReport?reportId=904e90c66caa4b72a5c632703ec8e1e1&cityname=',c_cityname, '&netservicename=',c_netservicename,'&currentPage=1 "target="_blank"> [趋势]  </A>'
            ) AS TRENT    
        FROM  mc_stat_city_service_jacking
WHERE monitor_date = '{STARTDATE}'
   and {CITYNAME}
   and {NETSERVICENAME}
   and date_type='day'     
前台显示的sql:

SELECT
        monitor_date,
        concat(c_cityname,'-',c_netservicename) as city_netservice,
        jacking,
       concat(
        
        '<A href="/repShow/lookReport?reportId=de747fe6904d4d5da2f243ad9b42082f&cityname=',c_cityname, '¤tPage=1&netservicename=',c_netservicename,'&fromDate=',monitor_date,' "target="_blank"> [详情2]  </A>',
        '<A href="/repShow/lookReport?reportId=904e90c66caa4b72a5c632703ec8e1e1&cityname=',c_cityname, '&netservicename=',c_netservicename,'¤tPage=1 "target="_blank"> [趋势]  </A>'
            ) AS TRENT    
        FROM  mc_stat_city_service_jacking
WHERE monitor_date = '{STARTDATE}'
   and {CITYNAME}
   and {NETSERVICENAME}
   and date_type='day'     
发现&currentPage被解析成¤tPage,整个sql只有这部分被解析出错了。我把&currentPage的&去掉后解析正常,把&currentPage放到第一个参数的位置改为?currentPage也正常,哪位大神知道原因给小弟传授一下?

加载中
返回顶部
顶部