修正错误

This commit is contained in:
wlx 2011-10-23 11:20:17 +00:00
parent 78e60b7317
commit 929a9798b5
1 changed files with 23 additions and 10 deletions

View File

@ -46,14 +46,16 @@ class Admin_WatermdController extends Zend_Controller_Action
//防止正则错误 //防止正则错误
if (!empty($new_data)) if (!empty($new_data))
{ {
$sql="update metadata set data=? where uuid=?"; $sql="update metadata set data=? where uuid='".$row['uuid']."'";
$this->wdb->query($sql,array($new_data,$uuid)); if ($this->wdb->exec($this->wdb->quoteInto($sql,$new_data)))
{
$dom = new DOMDocument(); $dom = new DOMDocument();
$dom->loadXML($formdata['source']); $dom->loadXML($row['data']);
$title=$dom->getElementsByTagName('resTitle')->item(0)->nodeValue; $title=$dom->getElementsByTagName('resTitle')->item(0)->nodeValue;
$deal['uuid']=$uuid; $deal['uuid']=$uuid;
$deal['title']=$title; $deal['title']=$title;
$this->view->deal[]=$deal; $this->view->deal[]=$deal;
}
} }
} }
} }
@ -84,6 +86,7 @@ class Admin_WatermdController extends Zend_Controller_Action
{ {
$sql="select uuid,data from metadata where istemplate = 'n'"; $sql="select uuid,data from metadata where istemplate = 'n'";
$rows=$this->wdb->fetchAll($sql); $rows=$this->wdb->fetchAll($sql);
$this->view->deal=array();
foreach($rows as $k=>$row) foreach($rows as $k=>$row)
{ {
//do the replace //do the replace
@ -91,14 +94,16 @@ class Admin_WatermdController extends Zend_Controller_Action
//防止正则错误 //防止正则错误
if (!empty($new_data)) if (!empty($new_data))
{ {
$sql="update metadata set data=? where uuid=?"; $sql="update metadata set data=? where uuid='".$row['uuid']."'";
$this->wdb->query($sql,array($new_data,$uuid)); if ($this->wdb->exec($this->wdb->quoteInto($sql,$new_data)))
{
$dom = new DOMDocument(); $dom = new DOMDocument();
$dom->loadXML($formdata['source']); $dom->loadXML($row['data']);
$title=$dom->getElementsByTagName('resTitle')->item(0)->nodeValue; $title=$dom->getElementsByTagName('resTitle')->item(0)->nodeValue;
$deal['uuid']=$uuid; $deal['uuid']=$uuid;
$deal['title']=$title; $deal['title']=$title;
$this->view->deal[]=$deal; $this->view->deal[]=$deal;
}
} }
} }
} }
@ -142,6 +147,7 @@ class Admin_WatermdController extends Zend_Controller_Action
{ {
$sql="select uuid,data from metadata where istemplate = 'n'"; $sql="select uuid,data from metadata where istemplate = 'n'";
$rows=$this->wdb->fetchAll($sql); $rows=$this->wdb->fetchAll($sql);
$this->view->deal=array();
foreach($rows as $k=>$row) foreach($rows as $k=>$row)
{ {
//do the replace //do the replace
@ -170,11 +176,15 @@ class Admin_WatermdController extends Zend_Controller_Action
//防止错误 //防止错误
if (!empty($new_data)) if (!empty($new_data))
{ {
$sql="update metadata set data=? where uuid=?"; $sql="update metadata set data=? where uuid='".$row['uuid']."'";
$this->wdb->query($sql,array($new_data,$uuid)); if ($this->wdb->exec($this->wdb->quoteInto($sql,$new_data)))
{
$dom = new DOMDocument();
$dom->loadXML($row['data']);
$deal['uuid']=$uuid; $deal['uuid']=$uuid;
$deal['title']=$title; $deal['title']=$title;
$this->view->deal[]=$deal; $this->view->deal[]=$deal;
}
} }
} }
} }
@ -291,6 +301,7 @@ class Admin_WatermdController extends Zend_Controller_Action
{ {
$sql="select uuid,data from metadata where istemplate = 'n'"; $sql="select uuid,data from metadata where istemplate = 'n'";
$rows=$this->wdb->fetchAll($sql); $rows=$this->wdb->fetchAll($sql);
$this->view->deal=array();
foreach($rows as $k=>$row) foreach($rows as $k=>$row)
{ {
//do the replace //do the replace
@ -326,11 +337,13 @@ class Admin_WatermdController extends Zend_Controller_Action
//防止错误 //防止错误
if (!empty($new_data)) if (!empty($new_data))
{ {
$sql="update metadata set data=? where uuid=?"; $sql="update metadata set data=? where uuid='".$row['uuid']."'";
$this->wdb->query($sql,array($new_data,$uuid)); if ($this->wdb->exec($this->wdb->quoteInto($sql,$new_data)))
{
$deal['uuid']=$uuid; $deal['uuid']=$uuid;
$deal['title']=$title; $deal['title']=$title;
$this->view->deal[]=$deal; $this->view->deal[]=$deal;
}
} }
} }
} }