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;
}
»¹ÓÐÆäËü·½·¨Âð£¿
Ïà¹ØÎĵµ£º
[ת×Ô]http://hi.baidu.com/heiday/blog/item/ce3217006b10c0df277fb5b1.html
phpº¯Êý getenv()Óëputenv()ºÍ$_SERVER
2009-07-09 15:03
getenv È¡µÃϵͳµÄ»·¾³±äÁ¿
Óï·¨£ºstring getenv(string varname);-----------²ÎÊývarnameÓ¦¸ÃÊÇ$_SERVER£¨·þÎñÆ÷³¬¼¶È«¾Ö±äÁ¿Êý×飩ÖÐÔ¤¶¨µÄÔªËØË÷ÒýÃû¡¢»òÕßÊÇÓÃputenv("new=very ......
Ò»¡¢¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a)·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii.Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server  ......
Oracle´æ´¢¹ý³Ìת³ÉSqlserver´æ´¢¹ý³Ì
1.ÈÕÆÚת»»
Oracle£º TO_NUMBER(TO_CHAR(SYSDATE, 'YYYYMMDD'))
SqlServer£ºCAST(CONVERT(CHAR(8),GETDATE(), 112) AS INT)
×¢£ºÆäÖБYYYYMMDD’¸ñʽ ¶ÔÓ¦112
2.ROWIDת»»
Oracle£º ROWID
SqlServer: PRIMARY KEY(±íÖ÷¼ü)
3.ROWNUM ......
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Îļþ£¬ÒÔÇ°µÄÎÄÕÂÖÐÒѾ½²¹ý» ......