PHP Import locomotive acquisition DB3 data into DEDECMS complete code _php tutorial

Source: Internet
Author: User
Tags mysql tutorial
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.