本文整理汇总了PHP中MyTextSanitizer::addSlashes方法的典型用法代码示例。如果您正苦于以下问题:PHP MyTextSanitizer::addSlashes方法的具体用法?PHP MyTextSanitizer::addSlashes怎么用?PHP MyTextSanitizer::addSlashes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyTextSanitizer
的用法示例。
在下文中一共展示了MyTextSanitizer::addSlashes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_metas
private function save_metas()
{
$this->db->queryF("DELETE FROM " . $this->db->prefix("rd_meta") . " WHERE section='" . $this->id() . "'");
if (empty($this->metas)) {
return true;
}
$sql = "INSERT INTO " . $this->db->prefix("rd_meta") . " (`name`,`value`,`section`,`edit`) VALUES ";
$values = '';
foreach ($this->metas as $name => $value) {
if (is_array($value)) {
$value = $value['value'];
}
$values .= ($values == '' ? '' : ',') . "('" . MyTextSanitizer::addSlashes($name) . "','" . MyTextSanitizer::addSlashes($value) . "','" . $this->getVar('id_sec') . "','1')";
}
if ($this->db->queryF($sql . $values)) {
return true;
} else {
$this->addError($this->db->error());
return false;
}
}
示例2: __construct
function __construct($id = '')
{
$this->db =& XoopsDatabaseFactory::getDatabaseConnection();
$this->_dbtable = $this->db->prefix("qpages_categos");
$this->setNew();
$this->initVarsFromTable();
if ($id == '') {
return;
}
if (is_numeric($id)) {
if (!$this->loadValues($id)) {
return;
}
} else {
$this->primary = 'nombre_amigo';
if (!$this->loadValues(MyTextSanitizer::addSlashes($id))) {
return;
}
}
$this->primary = 'id_cat';
$this->unsetNew();
}
示例3: xt_module_installed
/**
* Check if a modules is installed
* @param string Module dirname
* @return bool
*/
function xt_module_installed($dir)
{
if ($dir == '') {
return;
}
$db = Database::getInstance();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("modules") . " WHERE dirname='" . MyTextSanitizer::addSlashes($dir) . "'";
list($num) = $db->fetchRow($db->query($sql));
if ($num <= 0) {
return false;
}
return true;
}
示例4: saveMetas
/**
* Save existing meta
*/
private function saveMetas()
{
$this->db->queryF("DELETE FROM " . $this->db->prefix("qpages_meta") . " WHERE page='" . $this->getID() . "'");
if (empty($this->metas)) {
return true;
}
$sql = "INSERT INTO " . $this->db->prefix("qpages_meta") . " (`name`,`value`,`page`) VALUES ";
$values = '';
foreach ($this->metas as $name => $value) {
$values .= ($values == '' ? '' : ',') . "('" . MyTextSanitizer::addSlashes($name) . "','" . MyTextSanitizer::addSlashes($value) . "','" . $this->getID() . "')";
}
if ($this->db->queryF($sql . $values)) {
return true;
} else {
$this->addError($this->db->error());
return false;
}
}