我们有PHP服务器代码,执行对我们的iSeries中档SQL语句。
下面是SQL查询的简化版本
SELECT 'Regular' "sales_type", sum(sales_type1) "sales" FROM salesTable
查询执行就好了,问题是使用静态字段/值时,如“SomeText”“标题”,结果回来在PHP中,他们不是想要的格式
string(7) "م�����"
要连接到系统并检索结果
db2_connect ( '*LOCAL', 'user', 'pass' );
if (! $connection) {[error code]}
$stmt = db2_prepare ( $connection, $strSql );
if (! db2_execute ( $stmt ) ) { [error code ]
while ( $row = db2_fetch_array ( $stmt ) ) {
var_dump($row[1]);
}
我们对PHP版本5.2.17
我们的i系列是V7R1M0
一种解决服务器端的转换与PHP或SQL查询自身将是巨大的。
谢谢!
编辑
从雄鹿队的建议,我们已经改变了用户配置文件CCSID 37,而不是65535
现在我们回到(下图)这是一个有点接近...
string(7) "Ù…‡¤“™"
这可能是因为我们不仅改变了用户? 是否需要系统,作业或表进行过改变?
编辑2
这里是输出的phpinfo
_COOKIE["ZDEDebuggerPresent"] php,phtml,php3
_SERVER["ZendEnablerConfig"] /www/zendserver/conf/fastcgi.conf
_SERVER["PHPRC"] /usr/local/ZendSvr/etc/
_SERVER["PHP_FCGI_CHILDREN"] 40
_SERVER["PHP_FCGI_MAX_REQUESTS"] 0
_SERVER["CCSID"] 819
_SERVER["LANG"] C
_SERVER["INSTALLATION_UID"] 20101203131436121338
_SERVER["LDR_CNTRL"] MAXDATA=0x40000000
_SERVER["LIBPATH"] /usr/local/ZendSvr/lib
_SERVER["DB2NOEXITLIST"] TRUE
_SERVER["ORACLE_HOME"] .
_SERVER["ORA_NLS10"] no value
_SERVER["ORA_NLS_PROFILE33"] no value
_SERVER["FCGI_ROLE"] RESPONDER
_SERVER["REDIRECT_UNIQUE_ID"] UYKvWcCoAQIAAnZHWG8AABS@
_SERVER["REDIRECT_STATUS"] 200
_SERVER["UNIQUE_ID"] UYKvWcCoAQIAAnZHWG8AABS@
_SERVER["QIBM_USE_DESCRIPTOR_STDIO"] Y
_SERVER["HTTP_HOST"] vmas400.vm.com:10090
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["HTTP_X_REQUESTED_WITH"] XMLHttpRequest
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
_SERVER["CONTENT_TYPE"] application/x-www-form-urlencoded
_SERVER["HTTP_ACCEPT"] */*
_SERVER["REFERER"] http://vmas400.vm.com:10090ZendServer/Index/Index
_SERVER["HTTP_REFERER"] http://vmas400.vm.com:10090/ZendServer/Index/Index
_SERVER["REFERER_URL"] http://vmas400.vm.com:10090/ZendServer/Index/Index
_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate,sdch
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-US,en;q=0.8
_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.3
_SERVER["HTTP_COOKIE"] ZENDSERVERSESSID=7asfv608qffhv556msem6evi66; CosmeticContest=16062; CompanyWithStoreDetail=16061; TYLYClassAnalysis=16068; OrderDetail=17220; RmsOrders=17221; DailyReceipts=16063; DailySales=17562; OnOrder=16064; OpenPurchaseOrders=17566; RegularPriceRankings=17568; ReviewStatistics=17570; SalesAndStock=17573; StocksByPeriod=17575; Top10BestSellers=17577; ReplenishmentAssortment=17269; RABS=17616; FreeFormatSku=16473; TYLYSalesAndOH=21294; SalesRecapByDate=16312; VendorAgendaSummary=23219; BasicStock=23474; InStock=16067; RegSalesAvgStockSummary=21270; TYLYSalesMDGMByStore=23822; VendorAgenda=23826; Header=16066; usc=adam; hudi[u]=d106b7a04c0d94b8a0e7624a017ead98324b57e8; hudi[i]=fec51923e58c84db4647d2b3e11fe03ec3f0c202; FreeFormat=16506; __utma=118969486.352613215.1355776933.1365626094.1367348033.12; __utmz=118969486.1355776933.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ZDEDebuggerPresent=php,phtml,php3
_SERVER["PATH"] /bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"] Apache
_SERVER["SERVER_NAME"] vmas400.vm.com
_SERVER["SERVER_ADDR"] 192.168.1.2
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 172.16.129.193
_SERVER["DOCUMENT_ROOT"] /www/zendserver/htdocs/prod
_SERVER["SERVER_ADMIN"] [no address given]
_SERVER["SCRIPT_FILENAME"] /usr/local/zendsvr/gui/html/index.php
_SERVER["DOCUMENT_NAME"] /usr/local/zendsvr/gui/html/index.php
_SERVER["REMOTE_PORT"] 14259
_SERVER["REDIRECT_QUERY_STRING"] dojo.preventCache=1367519066445
_SERVER["REDIRECT_URL"] /ZendServer/Information/Phpinfo
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] dojo.preventCache=1367519066445
_SERVER["REQUEST_URI"] /ZendServer/Information/Phpinfo?dojo.preventCache=1367519066445
_SERVER["SCRIPT_NAME"] /ZendServer/index.php
_SERVER["DOCUMENT_URI"] /ZendServer/index.php
_SERVER["RULE_FILE"] conf/httpd.conf
_SERVER["PHP_SELF"] /ZendServer/index.php
_SERVER["REQUEST_TIME"] 1367519066
编辑
解
解决的办法是改变使用CCSID 37的用户配置文件,服务器作业使用CCSID 37.我们将进行手动更改,以便在重新启动作业时,他们没有回复。