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

ÈçºÎͨ¹ýPHP½«excelµÄÊý¾Ýµ¼ÈëMySQLÖÐ

  ÈçºÎͨ¹ýPHP½«excelµÄÊý¾Ýµ¼ÈëMySQLÖÐ
    ÔÚ¿ª·¢PHP³ÌÐòʱ£¬ºÜ¶àʱºòÎÒÃÇ»áÓн«Êý¾ÝÅúÁ¿µ¼ÈëÊý¾Ý¿âµÄÐèÇó£¬ÈçѧÉúÐÅÏ¢ÅúÁ¿Ìí¼Óµ½Êý¾Ý¿âÖУ¬¶øÊÂÏÈÓÃexcel±àÅźã¬¶ÔexcelʵÐвÙ×÷£¬±ãÊÇÎÒÃDZȽϳ£ÓõÄÑ¡Ôñ·½Ê½¡£
     ÔÚ¶ÔexcelµÄ²Ù×÷ÖУ¬phpExcelReade±ãÊǺܶàÈ˵Ĺ²Í¬Ñ¡Ôñ¡£ÔÚ¾ßÌåʵÏÖÖУ¬ÎÒÃÇ¿ÉÒÔÒÔÎļþÉÏ´«·½Ê½½«excelÎļþÉÏ´«µ½·þÎñÆ÷ÖеÄij¸öλÖã¬Í¨¹ýÒÔϲÙ×÷½«excelÖеÄÊý¾Ýµ¼Èëµ½Êý¾Ý¿âºó£¬ÔÚ½«ÉÏ´«µÄÎļþɾ³ý¼´¿É¡£
´úÂëÈçÏ£º
   
    $dir=dirname(__FILE__);                       //»ñÈ¡µ±Ç°½Å±¾µÄ¾ø¶Ô·¾¶
    $dir=str_replace("\\","/",$dir)."/";
    $filename='uploadFile.xls'; //¿ÉÒÔ¶¨ÒåÒ»¸öÉÏ´«ºóµÄÎļþÃû³Æ
    $result=move_uploaded_file($_FILES['upload']['tmp_name'],$dir.$filename);//¼ÙÈçÉÏ´«µ½µ±Ç°Ä¿Â¼ÏÂ
    if($result)  //Èç¹ûÉÏ´«Îļþ³É¹¦£¬¾ÍÖ´Ðе¼Èëexcel²Ù×÷
    {
     require_once 'phpExcelReader/Excel/reader.php';
     $data = new Spreadsheet_Excel_Reader();
     $data->setOutputEncoding('utf-8');//ÉèÖÃÔÚÒ³ÃæÖÐÊä³öµÄ±àÂ뷽ʽ,¶ø²»ÊÇutf8
      //¸Ã·½·¨»á×Ô¶¯ÅжÏÉÏ´«µÄÎļþ¸ñʽ£¬²»·ûºÏÒªÇó»áÏÔʾ´íÎóÌáʾÐÅÏ¢(´íÎóÌáʾÐÅÏ¢Ôڸ÷½·¨ÄÚ²¿)¡£
     $data->read("$filename");  //¶ÁÈ¡ÉÏ´«µ½µ±Ç°Ä¿Â¼ÏÂÃû½Ð$filenameµÄÎļþ
     error_reporting(E_ALL ^ E_NOTICE);
     //Èç¹ûexcel±í´ø±êÌ⣬Ôò´Ó$i=2¿ªÊ¼£¬È¥µôexcel±íÖеıêÌⲿ·Ö(Òª½«$i<=¸ÄΪ$i<·ñÔò»á²åÈëÒ»Ìõ¶àÓàµÄ¿ÕÊý¾Ý)
     for ($i = 2; $i < $data->sheets[0]['numRows']; $i++)
     {
      $sql = "INSERT INTO user (stuid,class,name,sex,classNum,tel,addr,remark)


Ïà¹ØÎĵµ£º

Oracle, DB2 ¼° MySQL ·ÖÒ³²éѯд·¨

 
ÏÖÔÚÔÚWEB Ó¦ÓÃÖÐʹÓ÷ÖÒ³¼¼ÊõÔ½À´Ô½ÆÕ±éÁË£¬ÆäÖÐÀûÓÃÊý¾Ý¿â²éѯ·ÖÒ³ÊÇÒ»ÖÖЧÂʱȽϸߵķ½·¨£¬
ÏÂÃæÁгöÁËOracle, DB2  ¼° MySQL ·ÖÒ³²éѯд·¨¡£
Ò»£ºOracle
select * from (select rownum,name from table where rownum <=endIndex )
where rownum > startIndex
¶þ£ºDB2
DB2·ÖÒ³²éѯ
SELECT * ......

mysql utf 8 ÂÒÂë½â¾ö======ÕýÈ·µÄ

mysql utf-8 ÂÒÂë½â¾ö
Êý¾Ý¿â 2009-09-15 12:34:33 ÔĶÁ327 ÆÀÂÛ0 ×ֺţº´óÖÐС
ÔÚÍøÉÏ¿´¹ýºÜ¶à½â¾ömysqlÂÒÂëµÄÌû×Ó£¬¿ÉÊÇдµÄ²»ÊÇÂÞÀïÂÞà¾͹ýÓÚ¸´ÔÓ¡£ÆäʵÂÒÂëûÄÇô¸´ÔÓ£¬ÊÇÍøÉϵĴóÏÀÃÇÏë¶àÁË¡£ÎÒÑо¿¹ýÒ»¶ÎÈÕ×Ó£¬×ܽá³öÒ»Ì××Ô¼ºµÄ½â¾ö·½°¸£¬Èç¹ûÄ㻹û½â¾öÂÒÂë¾ÍÓÃÎҵķ½·¨ÊÔһϡ£Îҵķ½°¸²»ÊÇ×îºÃµÄ£¬È´ÊÇ×î¼òµ¥Ò ......

mysql Êý¾Ý¿âÒýÇæ

Èç¹ûÄãÊǸöÈü³µÊÖ£¬²¢ÇÒ°´Ò»Ï°´Å¥¾ÍÄܹ»Á¢¼´¸ü»»ÒýÇæ¶ø²»ÐèÒª°Ñ³µ¿ªµ½³µ¿âÀïÈ¥»»£¬ÄÇ»áÊÇʲô¸Ð¾õÄØ£¿MySQLÊý¾Ý¿âΪ¿ª·¢ÈËÔ±Ëù×öµÄ¾ÍºÃÏñÊÇ°´°´Å¥»»ÒýÇ棻ËüÈÃÄãÑ¡ÔñÊý¾Ý¿âÒýÇ棬²¢¸øÄãÒ»Ìõ¼òµ¥µÄ;¾¶À´Çл»Ëü¡£ 
MySQLµÄ×Ô´øÒýÇæ¿Ï¶¨Êǹ»ÓÃÁË£¬µ«ÊÇÔÚÓÐЩÇé¿öÏ£¬ÆäËûµÄÒýÇæ¿ÉÄÜÒª±ÈÊÖÍ·ËùÓøüÊʺÏÍê³ÉÈÎÎñ¡£Èç¹ûÔ¸ ......

windows»·¾³ÏµÄPHP+Apache+MySqlµÄ»·¾³´î½¨

²Ù×÷ϵͳ: windows xp
php°æ±¾:5.2.5 http://www.php.net/downloads.php
Apache http server °æ±¾:2.2.6http://httpd.apache.org/download.cgi
Mysql°æ±¾: 6.0.3http://dev.mysql.com/get/Downloads/MySQL-6.0
1.apacheµÄ°²×°:
1)Ë«»÷apache_2.2.6-win32-x86-no_ssl.msiͼ±ê£¬Æô¶¯apache°²×°³ÌÐò£»
2£©°²×°ÒÔÒ»¸ö»¶Ó­ ......

MySQLµÄLOCK TABLES/UNLOCK TABLES

LOCK TABLES/UNLOCK TABLES ¾ä·¨
LOCK TABLES tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}
[, tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE} ...]
...
UNLOCK TABLES
LOCK TABLES Ϊµ±Ç°Ïß³ÌËø¶¨±í¡£UNLOCK TABLES Êͷŵ±Ç°Ïß³ÌÓµÓеÄËùÓÐËø¶¨¡£µ±Ï̷߳¢³öÁíÒ»¸ö LOCK TABLES£¬»òµ±Óë·þ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ