读取数据中的代码,结果被执行了。解决方案

WBOY
Release: 2016-06-13 12:55:09
Original
733 people have browsed it

读取数据中的代码,结果被执行了。
我用insert向mysql数据库插入了如下的数据:
for(int i=0;i 成功后,我在mysql 中的text型字字段中,编码类型是utf8_unicode_ci
是这样存放的
for(int i=0;i ,我的本意是把此偌,显示成文本,(并不是执行此代码,只是显示 一下。)

结果, php当成 for循环了,显示的都乱了。


PS
若向数据库中插入{ system.out.println(dst[i]); }
则读取,显示正常。
若向DB中插入for(int i=0;i 则,不正常。

如何办?


------解决方案--------------------
这是Java,PHP不知道怎么解析执行,另外,mysql也不支持这种for循环,不知道你说的显示的都乱了是什么情况
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!