Home >Backend Development >PHP Tutorial >Discuss solutions to problems related to PHP obtaining garbled Oracle data_PHP Tutorial

Discuss solutions to problems related to PHP obtaining garbled Oracle data_PHP Tutorial

WBOY
WBOYOriginal
2016-07-15 13:30:46994browse

The problem is:

Regardless of transcoding or not, the Chinese character obtained from oracle on the page is always displayed as "?", That is, question marks one by one.

Solution to the problem:

From the perspective of mysql query, I think set names *** is missing, but I asked the DBA, Oracle does not have a relevant command line, so this problem was eliminated;

focused the problem on transcoding, and spent half an hour adding test parameters to various places in the program to discover the root cause of the data. There was a problem, not in the transcoding, so I wrote a separate PHP Oracle query page for testing. The result was still garbled as I thought, so I immediately eliminated the problem with the page;

Finally, I asked for help from Google I found an article below, saying that environment variables need to be introduced into httpd under init.d. Since this machine does not have that startup file, I can only add the following code to apachectl:

<ol class="dp-xml"><li class="alt"><span><span>export </span><span class="attribute">NLS_LANGUAGE</span><span>=”SIMPLIFIED CHINESE” </span></span></li></ol>

Restart the apache service and the problem is solved! !


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446266.htmlTechArticleThe problem is: Regardless of transcoding or not, the Chinese obtained from oracle on the page is always displayed as? , that is, question marks one by one. Solution to the problem: From the perspective of mysql query, I think it is...
Statement:
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