PHP Tutorial to import the locomotive acquisition DB3 data into the DEDECMS complete code
$path = "D:PDOSPIDERRESULT.DB3";
$conn = new PDO ("SQLite: $path");
$array =array (', ', ', ');
if ($conn)
{
Echo (' Connection PDO success ');
}
Else
{
Echo (' Cnnection PDO fail, plase check Database server! ');
}
$count = 0;
$SP = new Splitword ();
foreach ($conn->query (' SELECT * from content limit 160,80 ') as $row)
{
Baise Info
$softtitle = MySQL Tutorial _escape_string (mb_convert_encoding ($row [3], ' GBK ', ' Auto ')). ' -js album ';//title
File title
$softcontent = Str_replace (' image/', ' http://g.111cn.cn/javascript tutorial/image/', mb_convert_encoding ($row
[4], ' GBK ', ' auto ');
File size of size
$softsize = ' unknown ';
File Downurl
$softurl = Str_replace ('. zip ', ', $row [' address ']);
$filetype = '. rar ';
$softpath = ' http://g.111cn.cn/javascript/'. $softurl. $filetype;
$view = '
Effect Preview Address
Target=_blank> '. $softtitle. '; /Effect Preview Address
Preg_match_all ("/(src| SRC) =["|" | {0,} ((.*). (gif|jpg|jpeg|png|bmp)) /isu ", $softcontent, $img _array);
$thum = Str_replace ("'", "', Str_replace ('" ', ' ', $img _array[2][0]));
$softlinks = Mysql_escape_string ("{dede:link islocal= ' 1 ' text= ' $localhost '}". $softpath. " {/dede:link} ");
$a = Strip_tags ($softcontent);
$b = $sp->splitrmm ($softtitle);
$keywords = Str_replace (' ', ', ', $b);
$desciption = ";//desc + split Word
$introduce = $softcontent. $desciption. $view;
$os = ' Win2003,winxp,win2000,win9x ';
Call out Link descript
$addsoft = "Insert into D_addonsoft (Typeid,filetype,language,softtype,accredit,
Os,softrank,officialurl,officialdemo,softsize,softlinks,introduce,templet,userip,redirecturl) ";
$addsoft. = "values
(' $typeid ', ' $filetype ', ' $language ', ', ', ' $os ', ' 3 ', ', ', ' $softsize ', ' ". $softlinks." ', ' $introduce ', ', ' 222.103.69.94 ', ') ";
mysql_query ($addsoft) or Die (' Addsoft '. $addsoft. Mysql_error ());/. $addsoft
$newid = mysql_insert_id ();
Read Insert New ID
$sortrank = time ();
Read the minutes and seconds when the system is currently
$click = Mt_rand (1000,10000);
Random Clicks, 10000 btween
$archives = "Insert into d_archives
(Id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,litpic,writer,source,pubdate, Senddate,mid,descripti
On,keywords) ";
$archives. = "values
(' $newid ', ' $typeid ', ' 0 ', ' $sortrank ', ' P ', ' 1 ', ' 3 ', ' 0 ', ' $click ', ' 0 ', ' $softtitle ', ' $thum ', ' $write ', ' unkown ', ' $ Sortrank ', ' $sortran
K ', 1, ' $desciption ', ' $keywords ');
mysql_query ($archives) or Die (' archives ' $archives. ' | '. Mysql_error ()); $archives.
$arctiny = "Insert into D_arctiny (id,typeid,typeid2,arcrank,channel,senddate,sortrank,mid) values
($newid, $typeid, 0,0,3, ' $sortrank ', ' $sortrank ', 1) ';
mysql_query ($arctiny) or Die (' Arctiny '. $arctiny. Mysql_error ());//$arctiny.
}
Echo ' has a total of many ', $count, "No Place to save";
This site original reprint annotated source. NET Tutorial ">www.bkjia.com
http://www.bkjia.com/PHPjc/444966.html www.bkjia.com true http://www.bkjia.com/PHPjc/444966.html techarticle The PHP tutorial imports the locomotive acquisition DB3 data into the Dedecms full code $path =d:pdospiderresult.db3; $conn = new PDO (sqlite: $path); $array =array (",", " ); if ($conn) {//echo (' Connec ...