本文整理汇总了PHP中Dal::quote方法的典型用法代码示例。如果您正苦于以下问题:PHP Dal::quote方法的具体用法?PHP Dal::quote怎么用?PHP Dal::quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dal
的用法示例。
在下文中一共展示了Dal::quote方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_network_valid
public static function is_network_valid($network_name)
{
return Dal::query_first("SHOW TABLES LIKE '" . Dal::quote($network_name) . "_comments'") ? TRUE : FALSE;
}
示例2: table_exists
function table_exists($tablename)
{
//$sql = "DESCRIBE $tablename";
$sql = "SHOW TABLES LIKE '" . Dal::quote($tablename) . "'";
$res = Dal::query($sql);
while (list($tname) = Dal::row($res)) {
if ($tname == $tablename) {
return TRUE;
}
}
return FALSE;
}
示例3: search
static function search($text, $limit = 0)
{
$text = Dal::quote($text);
$limit_sql = $limit ? " LIMIT {$limit}" : "";
$sth = Dal::query("SELECT content_id, comment_id FROM {comments} WHERE is_active = 1 AND (name LIKE '%{$text}%' OR subject LIKE '%{$text}%' OR homepage LIKE '%{$text}%' OR comment LIKE '%{$text}%') {$limit_sql}");
return Dal::all_assoc($sth);
}
示例4: findByTitle
public static function findByTitle($title)
{
$enc_title = Dal::quote($title);
$groups = array();
$sth = Dal::query("SELECT collection_id,title FROM {contentcollections} WHERE title LIKE '%{$enc_title}%' AND is_active=1");
while ($r = Dal::row($sth)) {
list($ccid, $title) = $r;
$groups[] = array('ccid' => (int) $ccid, 'title' => $title);
}
return $groups;
}
示例5: table_exists
function table_exists($tablename)
{
$sql = 'SHOW TABLES LIKE \'' . Dal::quote($tablename) . '\'';
$res = Dal::query($sql);
while (list($tname) = Dal::row($res)) {
if ($tname == $tablename) {
return TRUE;
}
}
return FALSE;
}
示例6: find_descendants
function find_descendants($parent_path)
{
$ret = array();
if (!preg_match("|/\$|", $parent_path)) {
$parent_path .= "/";
}
$sth = Dal::query("SELECT path, kind FROM svn_objects WHERE is_active=1 AND path LIKE '" . Dal::quote($parent_path) . "%' ORDER BY path DESC");
while (list($path, $kind) = Dal::row($sth)) {
$ret[] = array('path' => $path, 'kind' => $kind);
}
return $ret;
}