本文整理汇总了PHP中query::query方法的典型用法代码示例。如果您正苦于以下问题:PHP query::query方法的具体用法?PHP query::query怎么用?PHP query::query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类query
的用法示例。
在下文中一共展示了query::query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public static function get($id = null)
{
$q = new query(RUDE_DATABASE_TABLE_CALENDAR_LEGEND);
if ($id !== null) {
$q->where(RUDE_DATABASE_FIELD_ID, (int) $id);
$q->query();
return $q->get_object();
}
$q->query();
return $q->get_object_list();
}
示例2: get
public static function get($id = null)
{
$q = new query(RUDE_DATABASE_TABLE_REPORTS_CATEGORIES_ITEMS);
if ($id !== null) {
$q->where(RUDE_DATABASE_FIELD_ID, (int) $id);
$q->query();
return $q->get_object();
}
$q->query();
return $q->get_object_list();
}
示例3: get
public static function get($id = null)
{
$q = new query(RUDE_DATABASE_TABLE_SPECIALIZATIONS);
if ($id !== null) {
$q->where(RUDE_DATABASE_FIELD_ID, (int) $id);
$q->query();
return $q->get_object();
}
$q->order_by(RUDE_DATABASE_FIELD_NAME);
$q->query();
return $q->get_object_list();
}
示例4: nextid
function nextid($sequence)
{
$esequence = ereg_replace("'", "''", $sequence) . "_seq";
$query = new query($this, "Select * from {$esequence} limit 1");
$query->query($this, "REPLACE INTO {$esequence} values ('', nextval+1)");
if ($query->result) {
$result = @mysql_insert_id($this->connect_id);
} else {
$query->query($this, "CREATE TABLE {$esequence} ( seq char(1) DEFAULT '' NOT NULL, nextval bigint(20) unsigned DEFAULT '0' NOT NULL auto_increment, PRIMARY KEY (seq), KEY (nextval) )");
$query->query($this, "REPLACE INTO {$esequence} values ('', nextval+1)");
$result = @mysql_insert_id($this->connect_id);
}
return $result;
}
示例5: get_by_report
public static function get_by_report($report_id)
{
$q = new query(RUDE_DATABASE_TABLE_EDUCATION_PREVIEW);
$q->where(RUDE_DATABASE_FIELD_REPORT_ID, (int) $report_id);
$q->query();
return $q->get_object_list();
}
示例6: get_by_shortname
public static function get_by_shortname($shortname)
{
$q = new query(RUDE_DATABASE_TABLE_FACULTIES);
$q->where(RUDE_DATABASE_FIELD_SHORTNAME, $shortname);
$q->query();
return $q->get_object();
}
示例7: get_by_name
public static function get_by_name($name)
{
$q = new query(RUDE_DATABASE_TABLE_QUALIFICATIONS);
$q->where(RUDE_DATABASE_FIELD_NAME, $name);
$q->query();
return $q->get_object();
}
示例8: get_by_order
public static function get_by_order($education_id)
{
$q = new query(RUDE_DATABASE_TABLE_EDUCATION_ITEMS_VALUES);
$q->where('education_id', (int) $education_id);
$q->order_by('order_num', 'ASC');
$q->query();
return $q->get_object_list();
}
示例9: get_popup
public static function get_popup($user_id)
{
$q = new query(RUDE_DATABASE_TABLE_SETTINGS);
$q->where(RUDE_DATABASE_FIELD_USER_ID, (int) $user_id);
$q->where(RUDE_DATABASE_FIELD_NAME, 'popup');
$q->query();
return $q->get_object();
}
示例10: is_exists
public static function is_exists($id)
{
$q = new query(RUDE_DATABASE_TABLE_USERS);
$q->where(RUDE_DATABASE_FIELD_ID, (int) $id);
$q->query();
if ($q->get_object()) {
return true;
}
return false;
}
示例11: is_exists
public static function is_exists($name)
{
$q = new query(RUDE_DATABASE_TABLE_TRAINING_FORM);
$q->where(RUDE_DATABASE_FIELD_NAME, $name);
$q->query();
if ($q->get_object()) {
return true;
}
return false;
}
示例12: _get_message_tree
function _get_message_tree($id)
{
global $PHORUM, $DB;
$q = new query($DB);
$SQL = "Select id from {$PHORUM['ForumTableName']} where parent={$id}";
$q->query($DB, $SQL);
$tree = "{$id}";
while ($rec = $q->getrow()) {
$tree .= "," . _get_message_tree($rec["id"]);
}
return $tree;
}
示例13: get
public static function get($report_id = null, $year = null)
{
$q = new query(RUDE_DATABASE_TABLE_CALENDAR_ITEMS);
if ($year !== null) {
$q->where(RUDE_DATABASE_FIELD_YEAR, (int) $year);
}
if ($report_id !== null) {
$q->where(RUDE_DATABASE_FIELD_REPORT_ID, (int) $report_id);
}
$q->query();
return $q->get_object_list();
}
示例14: nextid
function nextid($sequence)
{
$esequence = $sequence . "_seq";
$query = new query($this, "select nextval('{$esequence}') as nextid");
if ($query->result) {
$row = $query->getrow();
$nextid = $row["nextid"];
} else {
$query->query($this, "create sequence {$esequence}");
if ($query->result) {
$nextid = $this->nextid($sequence);
} else {
$nextid = 0;
}
}
return $nextid;
}
示例15: while
while (is_array($rec)) {
$empty = false;
$name = $rec["name"];
$num = $rec["id"];
$description = $rec["description"];
if (!$rec["folder"]) {
$sSQL = "select count(*) as posts from {$rec['table_name']} where approved='Y'";
$tq = new query($DB, $sSQL);
if ($tq->numrows()) {
$trec = $tq->getrow();
$num_posts = $trec["posts"];
} else {
$num_posts = '0';
}
$sSQL = "select max(datestamp) as max_date from {$rec['table_name']} where approved='Y'";
$tq->query($DB, $sSQL);
$trec = $tq->getrow();
if (empty($trec["max_date"])) {
$last_post_date = "";
} else {
$last_post_date = phorum_date_format($trec["max_date"]);
}
$posts = "{$lNumPosts}: <strong>{$num_posts}</strong> ";
$last = "{$lLastPostDate}: <strong>{$last_post_date}</strong>";
$url = "{$list_page}.{$ext}?f={$num}{$GetVars}";
} else {
$last = $lForumFolder;
$url = "{$forum_page}.{$ext}?f={$num}{$GetVars}";
}
?>
<tr>