动易数据转成dedecms的php程序
2015-01-24信息快讯网
<?php //读取mdb数据库例程 set_time_limit(0); $conn = new com("ADODB.Connection"); $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("E:\web2\qq.mdb"); $conn->Open($connstr); $rs = new com("ADODB.RecordSet"); $rs->Open("select * from PE_Article Where ArticleID>0 orDER BY ArticleID ASC",$conn,1,1); $conn2 = mysql_connect("localhost","root",""); mysql_select_db("dede",$conn2); mysql_query("SET NAMES GBK",$conn2); $i=0; while(! $rs->eof) { $id = $rs->Fields('ArticleID')->value; $title = addslashes($rs->Fields('Title')->value); $classid = $rs->Fields('ClassID')->value; $keywordstr = $rs->Fields('Keyword')->value; $keywordstr = str_replace("|"," ",$keywordstr); $keyword = trim($keywordstr); $datestr = $rs->Fields('UpdateTime')->value; $datearr = explode("-",$datestr); $yy = $datearr[0] ; $mm = $datearr[1] ; $dd = rand(1,28); $time=mktime(0,0,0,$mm,$dd,$yy); $content =addslashes($rs->Fields('Content')->value); $content = str_replace('[InstallDir_ChannelDir]{$UploadDir}','/UploadFiles',$content); //$uploadfile = $rs->Fields('UploadFiles')->value; $sql0 = "select ID from dede_archives where ID='$id'"; $rs0 = mysql_query($sql0,$conn2); $row = mysql_fetch_array($rs0); if(intval($row['ID'])==0){ $sql1 = "insert into dede_archives (ID,typeid,channel,title,sortrank,pubdate,senddate,adminID,keywords) values ('$id','$classid',1,'$title','$time','$time','$time',1,'$keyword')"; $rs1 = mysql_query($sql1,$conn2); if(!$rs1){ echo $sql1; echo "<br>"; echo mysql_error(); echo "<br>"; //exit; } $id2 = mysql_insert_id(); if($id2>0){ $sql2 = "insert into dede_addonarticle (aid ,typeid, body ) values('$id','$classid','$content');"; $rs2 = mysql_query($sql2,$conn2); if(!$rs2){ echo $sql2; echo "<br>"; echo mysql_error(); echo "<br>"; //exit; } } } $rs->MoveNext(); $i++; if($i%50==0)sleep(5); } echo "完成"; ?>
php利用header函数实现文件下载时直接提示保存
php header 详细使用说明与使用心得第1/2页
dedecms 批量提取第一张图片最为缩略图的代码(文章+软件)
php 网页游戏开发入门教程一(webgame+design)
使用zend studio for eclipse不能激活代码提示功能的解决办法
php 服务器调试 Zend Debugger 的安装教程
JieqiCMS 杰奇1.5注册机php源码
php download.php实现代码 跳转到下载文件(response.redirect)
建站常用13种PHP开源CMS比较
PHP 执行系统外部命令 system() exec() passthru()
php 无限级 SelectTree 类
Dedecms常用函数解析
中国站长站 For Dede4.0 采集规则
dede全站URL静态化改造[070414更正]
PHP中文汉字验证码
一篇入门的php Class 文章
手把手教你使用DedeCms V3的在线采集图文教程
dedecms系统常用术语汇总
dede3.1分页文字采集过滤规则详说(图文教程)续四
dede3.1分页文字采集过滤规则详说(图文教程)续二
dede3.1分页文字采集过滤规则详说(图文教程)
dedecms模版制作使用方法
实现dedecms全站URL静态化改造的代码
dedecms中常见问题修改方法总结