Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÈëÃÅÖ¸µ¼£ºÈçºÎѧϰPHP£¿

ÿ¸öÈ˵Äѧϰ·½Ê½²»Í¬£¬Ð´ÕâƪÎÄÕµÄÄ¿µÄÊÇ·ÖÏíÒ»ÏÂ×Ô¼ºµÄѧϰ¹ý³Ì£¬½ö¹©²Î¿¼£¬²»ÒªÒ»Î¶µÄÓñðÈ˵Äѧϰ·½·¨£¬ÕÒ¶Ô×Ô¼ºÓÐÓõÄѧϰ·½Ê½
¾­³£ÔÚijЩÂÛ̳ºÍQQȺÀï¿´µ½Ò»Ð©ÅóÓÑ»áÎÊ“ÔõÑù²ÅÄÜѧºÃPHP£¬ÔõÑù²ÅÄÜѧºÃ***ÓïÑÔ ”£¬µ«±ðÈ˻شð×î¶àµÄÊÇ£º´Ó×òµ¥”µÄ¿ªÊ¼¡£
Õâ¸ö¼òµ¥Ò²ÐíÕæµÄ²»¼òµ¥£¬ºÇºÇ¡£Ï ......

php header() º¯ÊýÏê½â ÄÏÈý·½

.Ò»¡¢×÷Ó㺠 
         PHPÖ»ÊÇÒÔHTTPЭÒ齫HTMLÎĵµµÄ±êÍ·Ë͵½ä¯ÀÀÆ÷£¬¸æËßä¯ÀÀÆ÷¾ßÌåÔõô´¦ÀíÕâ¸öÒ³Ã棬ÖÁÓÚ´«Ë͵ÄÄÚÈÝÔòÐèÒªÊìϤһÏÂHTTPЭÒéÁË£¬ÓëPHPÎÞ¹ØÁË£¬¿É²ÎÕÕhttp://www.w3.org/Protocols/rfc2616/rfc2616¡£ 
       ......

PHPÌ×½Ó×Ö±à³Ì

Ì×½Ó×Ö±à³Ì£¬Ò»°ãʹÓÃc»òc++¡£ÌرðµÄÔÚwebÓ¦ÓóÌÐò¿ª·¢ÖУ¬³£ÓÃperlʵÏÖÌ×½Ó×Ö¡£³ý´ËÒÔÍ⣬ÓÃphp½øÐÐÌ×½Ó×Ö±à³ÌÒ²ÊÇÒ»¸öÑ¡Ôñ¡£Php¿ÉÒÔʤÈÎÂ𣿵±È»¿ÉÒÔ¡£PhpÊÇһßßÖÊÁ¿µÄwebÓ¦ÓóÌÐò¿ª·¢ÓïÑÔ£¬ËûµÄÐí¶àÌØÐÔ¿ÉÒÔ´¦ÀíÖÚ¶àµÄÈÎÎñ£¬ÍøÂç±à³ÌÒ²²»ÀýÍâ¡£
1. Àí½âÌ×½Ó×Ö
   
Mail¡¢ftp¡¢telnet¡¢nameºÍfingerÕ ......

php ÖÐ Cookie Ïê½â

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