Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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Äã¿ÉÄܲ»ÖªµÀµÄ10¼þÊÂ

1.ʹÓÃip2long() ºÍlong2ip()º¯ÊýÀ´°ÑIPµØַת»¯³ÉÕûÐÍ´æ´¢µ½Êý¾Ý¿âÀï¡£
¡¡¡¡ÕâÖÖ·½·¨°Ñ´æ´¢¿Õ¼ä½µµ½Á˽ӽüËÄ·ÖÖ®Ò»(char(15)µÄ15¸ö×Ö½Ú¶ÔÕûÐεÄ4¸ö×Ö½Ú)£¬¼ÆËãÒ»¸öÌض¨µÄµØÖ·ÊDz»ÊÇÔÚÒ»¸öÇø¶ÎÄÚÒ³¸ü¼òµ¥ÁË£¬¶øÇÒ¼Ó¿ìÁËËÑË÷ºÍÅÅÐòµÄËÙ¶È(ËäÈ»ÓÐʱ½ö½öÊÇ¿ìÁËÒ»µã)¡£
¡¡¡¡2.ÔÚÑéÖ¤EmailµØÖ·µÄʱºòʹÓÃcheckdnsrr() º¯ÊýÑéÖ¤ ......

uchome¶þ´Î¿ª·¢ php³ÌÐò½²½â£¨common.phpÎļþ½âÎö£©

index.phpÎļþµÚÒ»ÐоÍÊÇ°üº¬ÁË
include_once('./common.php');
ÎļþËùÒÔÏȶÔcommon.phpÎļþ½âÎö
<?php
/*
[UCenter Home] (C) 2007-2008 Comsenz Inc.
$Id: common.php 10981 2009-01-14 03:05:20Z liguode $
*/
//¶¨ÒåÒ»¸ö³£Á¿£¬ÓÃÀ´ÔÚÆäËûÒ³ÃæÖУ¬·ÀÖ¹±»¶ñÒâÓû§Ö±½Óµ÷ÓÃÆäËûPHPÎļþ¡£
@def ......

¹ØÓÚupdateÓï¾äÔÚsqlserverºÍAccessÖеĶԱÈ

sqlserver£ºupdate Table_A set Table_A.col1 = (select Table_B.col1 from Table_B where Table_A.col2 = Table_B.col2)
Access: UPDATE Table_ A, Table_B SET Table_ A.×Ö¶Î2 = Table_ B.×Ö¶Î2
WHERE Table_ A.񅧏=Table_ A.񅧏;
×Ô¼º¼ÇÏ£¬ÌáÐÑ×Ô¼º ......

¡¾×ª¡¿¸ß¼¶PHPÓ¦ÓóÌÐò©¶´ÉóºË¼¼Êõ

Ç°ÑÔ
PHPÊÇÒ»ÖÖ±»¹ã·ºÊ¹ÓõĽű¾ÓïÑÔ£¬ÓÈÆäÊʺÏÓÚweb¿ª·¢¡£¾ßÓпçƽ̨£¬ÈÝÒ×ѧϰ£¬¹¦ÄÜÇ¿´óµÈÌص㣬¾Ýͳ¼ÆÈ«ÊÀ½çÓг¬¹ý34%µÄÍøÕ¾ÓÐphpµÄÓ¦Ó㬰üÀ¨Yahoo¡¢sina¡¢163¡¢sohuµÈ´óÐÍÃÅ»§ÍøÕ¾¡£¶øÇҺܶà¾ßÃûµÄwebÓ¦ÓÃϵͳ£¨°üÀ¨ bbs,blog,wiki,cmsµÈµÈ£©¶¼ÊÇʹÓÃphp¿ª·¢µÄ£¬Discuz¡¢phpwind¡¢phpbb¡¢vbb¡¢wordpress¡¢boblog µÈµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ