|
Model:
PHP复制代码
class Corplink_model extends Model {
private $pdodb;
function __construct (){
global $pdodb;
parent ::Model();
$this->pdodb=$pdodb;
}
public function addlink ($name,$linkaddr,$pic,$topid,$corp_id){
$addtime=date("Y-m-d H:i:s");
$ipstr=$_SERVER["REMOTE_ADDR"];
$sqladd_link="insert into rivcrl_corplink (link_name,link_url,link_pic,link_addtime,link_ipstr,corp_id,
corp_topid) values('$name','$linkaddr','$pic','$addtime','$ipstr','$corp_id','$topid')";
$this->pdodb->query($sqladd_link);
}
复制代码
错误提示:Fatal error: Call to a member function query() on a non-object in F:\phpweb\food\riv360\framework\apps\models\corplink_model.php on line 21
也就是代码最后一行: $this->pdodb->query($sqladd_link);
求救……
|
|