From 7dccdbf83e20d89ed1502955ee513940c2d8f527 Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 1 Apr 2012 07:00:52 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DSQL=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/ISO19115.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index b80f8370..fde68f13 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -80,7 +80,7 @@ class ISO19115 public $mdContact; public $uuid; - public $doi; + public $doi=''; /** * 数据集标题 * 字符串 @@ -185,11 +185,10 @@ class ISO19115 } //save metadata into database - $sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created, - timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $sth=$db->prepare($sql); try { - $sth->execute(array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat, + $sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created, + timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat, $this->projection,$this->datatype,$this->filesize,$this->mdDateSt,$this->timebegin,$this->timeend,$this->geoBox['w'], $this->geoBox['s'],$this->geoBox['n'],$this->geoBox['e'],$this->doi)); $id=$db->lastInsertId('metadata','id'); @@ -232,15 +231,14 @@ class ISO19115 $sth=$db->prepare($sql); $sth->execute(array($ds['seriesName'])); $trow=$sth->fetch(); - $trow=$seriestable->fetchRow($where); if ($trow) - $sid=$trow['id']; + $sid=$trow->id; else { $sql="insert into series (name) values(?)"; $db->query($sql,array($ds['seriesName'])); $sid=$db->lastInsertId('series','id'); } - $sql="insert into dataserires (id,sid) values(?,?)"; + $sql="insert into dataseries (id,sid) values(?,?)"; $db->query($sql,array($id,$sid)); } //处理XML入库 @@ -313,7 +311,6 @@ class ISO19115 //数据重复插入,此处忽略所有错误 print $this->uuid.' has error: '.$e->getMessage().'
'; } - } function parse()