PHP²éѯÏÔʾSqlServerÖеÄÖÐÎÄ
ÒòΪ¹¤×÷ÐèÒª£¬Êý¾Ý¿âʹÓõÄMS SQL Server2005£¬¶øĬÈϵÄÅÅÐò¹æÔòÊÇSQL_Latin1_General_CP1_CI_AS¡£´´½¨ÁËÒ»¸ö±í£¬ÒòΪÐèÒª´æ´¢ÖÐÎÄÐÅÏ¢£¬Address×ֶεÄÀàÐÍÊÇnvarchar(255)¡£
´ËʱʹÓÃphpÀ´Á¬½Ósql server£¬Ò³ÃæµÄ±àÂëºÍÎļþµÄ±àÂ붼ÊÇUTF-8£¬²éѯ´ËAddress×ֶΣ¬ÏÔʾÔÚÒ³ÃæÉÏÊÇ???Ö®ÀàµÄ¡£Ôõô½â¾ö£¿
ʹÓÃ
iconv('iso-8859-1','utf-8',$address);
ÊÇûÓÐʲôÓô¦µÄ¡£
´ËʱÈç¹ûSQLÒ»Óï¾äÖÐÖ¸¶¨×Ö·ûÅÅÐò¹æÔòΪÖÐÎÄÔÙ½øÐÐת»»Êä³öµÄ²ÅÊÇÕý³£µÄ£º
$query = 'select Address collate Chinese_PRC_CI_AS from A';
$rs = mssql_query($query,$conn) or die ('Query failed: '.$query);
if ($row = mssql_fetch_array($rs))
{
$address = $row[0];
$address = iconv('GBK','UTF-8',$address);
echo $address;
}
»¹ÓÐÆäËü·½·¨Âð£¿
Ïà¹ØÎĵµ£º
¡¡¡¡PHP ÖУ¬Êý¾Ýͨ³£¶¼ÊÇ´æ´¢ÔÚMySQLÊý¾Ý¿âµ±Öеġ£µ«ÊÇÓÐЩʱºò£¬ÎÒÃÇ»¹ÊÇÐèҪʹÓÃPHP¶ÁдһЩ±¾µØÎļþ¡£±ÈÈçÉú³É¾²Ì¬Ò³Ãæ»òÕßÊý¾ÝµÄ±¾µØ»º´æ¡£
¡¡¡¡PHP5+ ÌṩÁËÒ»ÖÖ·½·¨ file_put_contents(file,data,mode,context)£¬Ëü½«Ò»¸ö×Ö·û´®Ð´ÈëÎļþ£¬·µ»ØдÈëµ½ÎļþÄÚÊý¾ÝµÄ×Ö½ÚÊý¡£ºÍÒÀ´Îµ÷Óà fopen()£¬fwr ......
1.°²×°ºÃSQLServer 2005Êý¾Ý¿âÈí¼þ£¬½Ó×Å×îÖØÒªµÄ¾ÍÊÇ°²×°Êý¾Ý¿âÇý¶¯SQL Server 2005 driver for JDBC£¬¿ÉÒÔµ½:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exeÏÂÔØ
2.½«JDBC½âѹµ½ÈÎÒâµÄλÖã¬ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ½²¹ ......
1.°²×°ºÃSQLServer 2005Êý¾Ý¿âÈí¼þ£¬½Ó×Å×îÖØÒªµÄ¾ÍÊÇ°²×°Êý¾Ý¿âÇý¶¯SQL Server 2005 driver for JDBC£¬¿ÉÒÔµ½:http://download.microsoft.com/download/8/B/D/8BDABAE2-B6EA-41D4-B903-7916EF3690EF/sqljdbc_1.2.2323.101_enu.exeÏÂÔØ
2.½«JDBC½âѹµ½ÈÎÒâµÄλÖã¬ÔÚ°²×°Ä¿Â¼ÀïÕÒµ½sqljdbc.jarÎļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ½²¹ý» ......
Ò»¡¢zend studioµÄÅäÖÃ
1.µ½zendµÄ°²×°Ä¿Â¼ÏÂɾ³ýÁ½¸öÎļþ(¿ÉÓпÉÎÞ.ÖÁÉÙÎÒ²»É¾³ýÒ²²»Òƶ¯¿ÉÒÔ)
ÎҵݲװĿ¼£ºD:\Program Files\Zend\Zend Studio - 7.0.2\plugins\
ɾ³ýµÄÎļþÊÇ£ºcom.zend.php.debug.core_7.0.0.v20090607-1658.jar
&nbs ......
ÉùÃ÷£º²¹³ä·ÒëÁËÔÌûÖм¸´¦Î´·Òë´¦¡£
---------------------------------------------------- תÌû¿ªÊ¼ -------------------------------------------------------
PHPÖеÄCURLº¯Êý¿â£¨Client URL Library Function£©
curl_close - ¹Ø±ÕÒ»¸öcurl»á»°
curl_copy_handle - ¿½±´Ò»¸öcurlÁ¬½Ó×ÊÔ´µÄËùÓÐÄÚÈݺ ......