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

php+mysqlÂÒÂëÎÊÌâ

ÎÊÌâÃèÊö£º
´Óphp½çÃæinsertÊý¾Ýµ½mysql£¬Ö»ÄÜÊäÈëżÊý¸öºº×Ö²»ÄÜÊäÈëÆæÊý¸öºº×Ö£¬ÊäÈëÆæÊý¸öºº×ֺ󱨓Data too long for column ”´íÎ󣬲¢Ã»Óиü¸ÄÊý¾Ý¿âÊý¾Ý¡£µ½Êý¾Ý¿â²é¿´£¬·¢ÏÖºº×Ö¶¼ÊÇÂÒÂë¡£µ«ÊÇphp½çÃæÏÔʾºº×ÖÕý³££¨µ±È»ÏÔʾµÄ¶¼ÊÇżÊý¸öºº×Ö£¬ÆæÊý¸öºº×Ö¶¼Ã»ÓÐдÈëÊý¾Ý¿â£©¡£
½â¾ö˼·£º
1.¸ü¸Ämy.iniÎļþ£¬°Ñsql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”¸Ä³Ésql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”£¨¾ÍÊÇÈ¥µôSTRICT_TRANS_TABLES£©¡£ÖØÆômysql¡£
ÕâÑù×öµÄ½á¹ûÊÇ£¬²»»á±¨“Data too long for column ”£¬ÓÚÊÇÆæÊý¸öºº×Ö¾ÍÄÜ´æÈëÊý¾Ý¿â¡£µ«ÊÇphp½çÃæÏÔʾÆæÊý¸öºº×ֵĵط½³ö´í£¬¸ù¾Ý´íÎó¿ÉÒÔ·¢ÏÖÊǺº×Ö½âÎöʱ°Ñ²¿·Ö´úÂëÎóÈÏÒ»²¢½âÎöÁË£¬ËùÒÔphp½çÃæÏÔʾ²»Õý³£¡£Õâ˵Ã÷ÊǺº×Öת»»µÄ´íÎó(¶ÔÓÚºº×ÖUTF8ÔòÐèÒª3 Bytes¶øANSI/Unicode/UCS2±àÂ붼ֻÓÃ2 Bytes£¬´ËʱÊäÈ뺺×ֵĸöÊýΪ2¸öʱÊý¾Ý¿âÀïµÄÂÒÂëÊÇ3¸ö£¬ËµÃ÷1¸öÂÒÂëÊÇ2 Bytes£¬½âÎöµ½½çÃæʱûÓÐȱʧËùÒÔ¿ÉÒÔÕý³£ÏÔʾ£»¶øÊäÈ뺺×ֵĸöÊýΪ1¸öʱÊý¾Ý¿âÀïµÄÂÒÂëÊÇ1¸ö£¬ËµÃ÷±äÂÒÂëʱʧȥÁË1 Byte£¬½âÎöµ½½çÃæʱÓÐȱʧËùÒÔ²»ÄÜÕý³£ÏÔʾ)¡£
2.дһ¸ö¹ØÓÚinsert»òupdateÆæÊý¸öºº×ÖµÄtest.sqlÎļþ´æ³Éutf8·ÅÔÚCÅÌ¡£ÔÚmysqlÀïÖ´ÐÐsource c:/test.sql£»
½á¹û·¢ÏÖÈÔÈ»ÊÇÂÒÂë¡£ËùÒÔÈ·¶¨mysqlµÄcharacterÉèÖÃÓÐÎÊÌâ¡£
3.ѧϰÐÞ¸ÄmysqlµÄcharacterÉèÖá£
MySQL 4.1ÒÔÉÏ°æ±¾µÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î: ·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£ÎÒÃÇ×îÖÕµÄÄ¿±êÊÇʹµÃÕâËĸö²ã´Îת»¯»áÖ§³ÖÖÐÎĵıàÂë¡£
ÃüÁîÒ»£ºmysql> SHOW VARIABLES LIKE ''character_set_%'';
          ²é¿´ÏµÍ³µÄ×Ö·û¼¯£¬½á¹ûÈçÏÂ
          +--------------------------+---------------------------------------------------------+
          | Variable_name            | Value               &


Ïà¹ØÎĵµ£º

PHPÖÐJSONµÄÓ¦Óà ÄÏÈý·½

»¥ÁªÍøµÄ½ñÌ죬AJAXÒѾ­²»ÊÇʲôİÉúµÄ´Ê»ãÁË¡£ËµÆðAJAX£¬¿ÉÄÜ»áÁ¢¼´ÏëÆðÒòRSS¶øÐËÆðµÄXML¡£XMLµÄ½âÎö£¬¿ÖÅÂÒѾ­²»ÊÇʲôÄÑÌâÁË£¬ÌرðÊÇPHP5£¬´óÁ¿µÄXML½âÎöÆ÷µÄÓ¿ÏÖ£¬Èç×îÇáÁ¿¼¶µÄSimpleXML¡£²»¹ý¶ÔÓÚAJAXÀ´Ëµ£¬XMLµÄ½âÎö¸üÇãÏòÓÚǰ̨JavascriptµÄÖ§³Ö¶È¡£ÎÒÏëËùÓнâÎö¹ýXMLµÄÈË£¬¶¼»áÒòÊ÷ºÍ½Úµã¶øÍ·´ó¡£²»¿É·ñÈÏ£¬XMLÊÇºÜ ......

php ÖÐ Cookie Ïê½â

1.ÓÃ;:
        ·þÎñÆ÷¿ÉÒÔÀûÓÃCookies°üº¬ÐÅÏ¢µÄÈÎÒâÐÔÀ´É¸Ñ¡²¢¾­³£ÐÔά»¤ÕâЩÐÅÏ¢£¬ÒÔÅжÏÔÚHTTP´«ÊäÖеÄ״̬¡£Cookies×îµäÐ͵ÄÓ¦ÓÃÊÇÅж¨×¢²áÓû§ÊÇ·ñÒѾ­µÇ¼ÍøÕ¾£¬Óû§¿ÉÄÜ»áµÃµ½Ìáʾ£¬ÊÇ·ñÔÚÏÂÒ»´Î½øÈë´ËÍøվʱ±£ÁôÓû§ÐÅÏ¢ÒÔ±ã¼ò»¯µÇ¼ÊÖÐø£¬ÕâЩ¶¼ÊÇCookiesµÄ¹¦Óá£ÁíÒ»¸öÖØÒ ......

PHP±àÒëÅäÖúÍÅäÖÃÎļþ˵Ã÷


PHP°²×°ÅäÖÃ˵Ã÷
Ò»¡¢Èí¼þÏÂÔØ
PHP5.3.0:http://cn2.php.net/get/php-5.3.0.tar.gz/from/this/mirror
Pear£ºhttp://de.pear.php.net/get/PEAR-1.9.0.tar
Mm£ºftp://ftp.ossp.org/pkg/lib/mm/mm-1.4.2.tar.gz
¶þ¡¢»·¾³¼ì²é
ÒÑ°²×°Apache2.2.13(/usr/local/apache/),mm-1.4.2£¨/usr/local/mm/£©
rpm -qa|grep mcrypt ......

ÓÃPHPÉú³ÉÑéÖ¤Âë¿ÉÒÔ½øÐеã»÷Ë¢ÐÂ

ÑéÖ¤ÂëµÄ´óÖÂÔ­ÀíÊÇÕâÑùµÄ£¬Ê×ÏÈÉú³ÉÒ»¸öËæ»úÊý£¬È»ºóÔÚÊý¾ÝÊýÉÏÃæ¼ÓÉϸÉÈÅͼƬ£¬Í¬Ê±°Ñ¸ÃÊý¾ÝÉú³ÉͼƬ²¢Êä³ö¡£
Õâ¸öÊý¾Ý±£´æÔÚsessionÖС£È»ºó°ÑÓû§µÄÊäÈëÓë±£´æÔÚsessionÖеÄÊý¾Ý½øÐÐÆ¥Å䣬½øÐÐÑéÖ¤¡£
verifyCode.php´úÂëÈçÏ£º
<?php
Header("Content-type: image/PNG");
session_start();
//× ......

php(gd¿â£©Êä³öÖÐÎÄͼÏñµÄת»»º¯Êý

http://linux.sheup.com/linux/linux4646.htm
GB2312->UTF-8 ת»»º¯Êý
ÒÔÏÂÊÇÒ»¶Îgb2312 -> UTF-8 µÄº¯Êý£¬Î÷Î÷£¬ÎÒ³­ÁË
unicode -> UTF-8 µÄËã·¨£¬ËùÒÔʵ¼Ê±ÈGB2312->unicode
û¶à¶àÉÙ¶«Î÷,Çë´ó¼Ò×¢Òâµ÷ÓÃgb2utf8()ʱ²»ÄÜÖÐÓ¢ÎÄ»ìÓÃ
³ÌÐòÐèÒªµÄGB2312.txtÎļþ
gb2utf8.php
//Program writen by s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ