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

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3£©È»ºóÔÙinsertµ½Êý¾Ý¿âÀï

µ«ÊÇÖмäµÄת»»Ëƺõ³ýÁËÎÊÌ⣬ûÓÐÊý¾Ý
Çë¸÷λ°ïæ¿´¿´ÊDz»ÊÇÄÄÀï³öÁËÎÊÌâ

¡ý¡ý¡ý
if ($_FILES['csv_file_road']['tmp_name'] != '') {
$all_name = $_FILES['csv_file_road']['tmp_name'];
$file_name = $ADDRESS_CSV_COMMON_USER.'.csv';
if(!copy($all_name,CSVWAY.$file_name)){
$messageStack->add("ÎļþÉÏ´«Ê§°Ü", 'error');
return;
}
}
$handle = fopen (CSVWAY.$file_name,"r");
while ($data = fgetcsv ($handle, 5000, ",")) {
$row_num = $row_num+1;//now read csv row-num
$error_info = "";
if($row_num == 1){
continue;
}
$num = count ($data);
if($num < 14){
continue;
}
for ($c1=0; $c1 < $num; $c1++) {
            $data[$c1] = mb_convert_encoding($data[$c1],'UTF-8',"GB2312,shift_jis");
          }
         
$check_array['SUBJECT'] = trim($data['1']);
$check_array['


Ïà¹ØÎÊ´ð£º

sql ʱ¼äÎÊÌâ

sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001

ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......

SQL serverÊý¾Ý¼¯³ö´íÇóÖú

Á½ÖÖ´íÎó£º
1.Èç¹ûÎÒÕâÑùÉêÃ÷£ºResultSet rs;´íÎóÌáʾÈçÏ£º

An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48:    ......

SQLÓï¾äÎÊÌ⣬¸ßÊÖ°ï棡£¡

½«Ò»¸ö±í21~30ɾ³ý£¬sqlÓï¾äÔõôд
Õâ¸öÌ«ÁýͳÁË£¬ÊÇÅÅÐòºóµÄµÚ21Ìõµ½30Ìõ¼Ç¼ɾ³ý»¹ÊÇijһÁÐÖµÔÚ21µ½30Ö®¼äµÄɾ³ý°¡£¿

21-30ÊÇʲôÒâ˼£¿×ֶεĻ°¾Ídelete from table1 where col1>=21 and col1<=30
Ö¸µ ......

sql ²éѯ

  ÎÒÓÐÒ»¸öÔºÍÈÕ×é³ÉµÄÊý×Ö£¬ÓÐÁ½×éÔºÍÈÕ
ÏëÔÚÉí·ÝÖ¤ºÅÖÐÌôÑ¡³öÔڸøÃÁ½×éÔÂÈÕÖ®¼ä³öÉúµÄÈË£¬²»ÖªµÀÓ¦¸ÃÔõôд.
Éí·ÝÖ¤ºÅÓпÉÄÜÊÇ15λ»òÕß18λ

ÔÂÈÕ×éºÏµÄÐÎʽÈçÏÂ
10-17/04-20
ÔÂ-ÈÕ/ÔÂ- ......

SQLÁ½±íÁ¬½Ó£¬²åÈëÊý¾ÝµÄÎÊÌâ

ÎÒÏÖÔÚÓÐÁ½ÕÅ±í£º
    Ò»ÕÅuser±íÓÐname£¨ÐÕÃû£©ºÍstarID£¨ÐÇ×ùµÄID£©Á½¸öÁУ¬»¹ÓÐÒ»ÕÅstars±íÓÐID£¨ÐÇ×ùµÄID£©ºÍstar£¨ÐÇ×ùÃû£©Á½¸öÁУ¬È»ºóstars±íµÄIDÊÇÖ÷¼ü£¬user±íµÄstarIDÊÇÍâ¼ü¡£

ÎÊÌâ¾Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ