<?php 

$sql = 'SELECT `bbsid`, `userid`, `title`, `content`, `pic`, `name`, `time`, `gro`, `v`, `top`, `zip`, `siteid`, `waptop`, `good`, `zan`, `xi`, `nu`, `zipstr` FROM `bbs` '; 
        $result = mysql_query($sql);
		if($result && mysql_num_rows($result)>0){
	    $i=0;
	    while(list($bbsid,$userid,$title,$content,$pic,$name,$time,$gro,$v,$top,$zip,$siteid,$waptop,$good,$zan,$xi,$nu,$zipstr)= mysql_fetch_row($result)){
	      echo "\$sql=\"INSERT INTO `bbs` VALUES ('$bbsid',' $userid','$title','$content','$pic','$name','$time','$gro','$v','$top','$zip','$siteid','$waptop','$good','$zan','$xi','$nu', '$zipstr');\";
		  
		  \$result = mysql_query(\$sql);
		   if(\$result && mysql_num_rows()>0){
		    echo '$bbsid 导入成功<br>';
			}else{
			 echo '$bbsid 导入失败<br>';
			}
			
			";
		   
		}
   }
   $sql = 'SELECT `cid` , `cn` , `siteid` , `url` , `list` , `gro` , `xuhao` , `q` , `top` , `bottom` FROM `class` ';
         $result = mysql_query($sql);
		if($result && mysql_num_rows($result)>0){
	    while(list($cid , $cn , $siteid , $url, $list , $gro , $xuhao , $q , $top , $bottom)= mysql_fetch_row($result)){
		 echo "\$sql=\"INSERT INTO `class` VALUES ('$cid' , '$cn' , '$siteid' , '$url' , '$list' , '$gro' , '$xuhao' , '$q' , '$top' , '$bottom');\";
		  
		  \$result = mysql_query(\$sql);
		   if(\$result && mysql_num_rows()>0){
		    echo '$cid 导入成功<br>';
			}else{
			 echo '$cid 导入失败<br>';
			}
			
			";
		
		     }
		}
		$sql = 'SELECT `articleid` , `userid` , `title` , `content` , `pic` , `name` , `time` , `gro` , `v` , `top` , `spic` , `siteid` FROM `article` '; 
		 $result = mysql_query($sql);
		if($result && mysql_num_rows($result)>0){
	    while(list($articleid, $userid , $title, $content, $pic, $name, $time, $gro, $v, $top, $spic, $siteid)= mysql_fetch_row($result)){
		   echo "\$sql=\"INSERT INTO `article` VALUES (`$articleid` , `$userid` , `$title` , `$content` , `$pic` , `$name` , `$time` , `$gro` , `$v` , `$top` , `$spic` , `$siteid`);\";
		  
		  \$result = mysql_query(\$sql);
		   if(\$result && mysql_num_rows()>0){
		    echo '$cid 导入成功<br>';
			}else{
			 echo '$cid 导入失败<br>';
			}
			
			";
		   
		   }
		}
?>