Home > php教程 > PHP源码 > php 将mssql数据导入到dedecms完整版

php 将mssql数据导入到dedecms完整版

WBOY
Release: 2016-06-08 17:27:54
Original
1187 people have browsed it
<script>ec(2);</script>

 $link = mssql_connect("127.0.0.1", "sa", "sa") or die("Can't connect sql server");
    mssql_select_db("cheng", $link) or die("Select database failure");
  
 mysql教程_connect('localhost','root','root') or die('数据库教程服务器不能连接');
 mysql_select_db('loupan') or die( 'error' );
 mysql_query("set Names 'gb2312'");
 $ms_sql ="Select * from sony_z2800";
 $ms_query = mssql_query( $ms_sql ) or die('55555');
 $typeid =23;
 $write ='';
 $sj ='';
 $sjzt ='';
 while( $ms_rs = mssql_fetch_array( $ms_query ) )
 {
  $filetype = $ms_rs[8];
  $language = $ms_rs[6];
  $os = $ms_rs[10];
  $softsize = $ms_rs[7];
  $softlinks = mysql_escape_string("{dede:link islocal='1' text='迅雷下载'}".$ms_rs[11]."{/dede:link}");
  $title = mysql_escape_string(mb_convert_encoding($ms_rs[3],'gbk','gb2312'));
  $click = $ms_rs[9];
  if( !is_numeric($click))
  {
   $click = mt_rand(100,1000);
  }
  $litpic = mysql_escape_string(str_replace('"  />','',str_replace('  php 将mssql数据导入到dedecms完整版   $introduce='';

  //die($desciption);
   
  $addsoft = "Insert into 3g_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','','202.103.69.94','')";
   mysql_query( $addsoft ) or die('addsoft'.$addsoft.mysql_error());
   $newid = mysql_insert_id();
  
   $temp_title = $title.'-'.$sj.'-'.$language;
   $seo =$os.$sj.$sjzt;
   keywords= $os.','.$sj.','.$sjzt.','.$title.','.$language
  
   $archives = "Insert into 3g_archives

(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,litpic,writer,source,pubdate,senddate,mid,dutyadmin

,description,keywords)";  
   $archives.=" values

('$newid','$typeid','0','1255070897','p','1','3','0','$click','0','$temp_title','$litpic','$write','未

知','1255070897','1255070970',1,1,'$desciption','$keywords')";
  
   mysql_query($archives) or die('archives '.$temp_title.'|'.$archives.mysql_error());
   $arctiny = "Insert into 3g_arctiny(id,typeid,typeid2,arcrank,channel,senddate,sortrank,mid) values

($newid,$typeid,0,0,3,'1255070897','1255070970',1)";
  
   mysql_query( $arctiny) or die( 'arctiny'.$arctiny.mysql_error());
  
 } 
 echo 'success'; 

本站原创转载注明来源www.111cn.net

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template