skymvc分库通过config配置即可实现,所以我们开发的时候可以像单库一样,后期通过配置即可实现分库 $dbclass="mysqli";$dbconfig["master"]=array( "host"="127.0.0.1:3306","user"="root","pwd"="123","database"="
$dbclass="mysqli"; $dbconfig["master"]=array( "host"=>"127.0.0.1:3306","user"=>"root","pwd"=>"123","database"=>"skymvc" ); /**其他分表库**/ $dbconfig["user"]=array( "host"=>"localhost","user"=>"root","pwd"=>"123","database"=>"skymvc" ); $dbconfig["article"]=array( "host"=>"localhost","user"=>"root","pwd"=>"123","database"=>"skymvc" ); /*分库配置*/ $VMDBS=array( "article"=>"article", "forum"=>"article" ); M("article")->selectRow(); M("forum")->selectRow();分表操作,主要支持id分表
$id=M("log_id")->insert(); M("log")->setTable("log",$id,10)->insert(); //当然可以自己设置分布表 M("log_abc")->insert();