本文整理汇总了PHP中Sql::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Sql::query方法的具体用法?PHP Sql::query怎么用?PHP Sql::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sql
的用法示例。
在下文中一共展示了Sql::query方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendmsg
function sendmsg($data)
{
$outp = array("ec" => 1, "data" => 0);
$recvlist = intexplode("-", $data["rid"]);
$msgdata = Fun::getflds(array("msg"), $data);
$msgdata["msg"] = trim($msgdata["msg"]);
if ($data["msg"] != "") {
$msgdata["time"] = time();
$msgid = Sqle::insertVal("msgdata", $msgdata);
$msg_table_arr = array();
foreach ($recvlist as $i => $rid) {
$msg_table_arr[] = array(User::loginId(), $rid, User::loginId(), $msgid, 'u');
//u for unseen
$msg_table_arr[] = array(User::loginId(), $rid, $rid, $msgid, 'u');
}
$outp["data"] = Sql::query("insert into msg (sid,rid,aid,msgid,isseen) " . Fun::makeDummyTableColumns($msg_table_arr, array("sid", "rid", "aid", "msgid", "isseen"), 'iiiis'));
}
return $outp;
}
示例2: prvnotf
public static function prvnotf($uid, $sid, $mfile, $data, $url)
{
$content = Fun::rmsg(file_get_contents($mfile), $data);
$nid = Sqle::insertVal("notf", array("uid" => $uid, "sid" => $sid, "content" => $content, "time" => time(), "isr" => "0", "url" => $url));
if (strpos($url, '?')) {
$url = $url . "¬fid=";
} else {
$url = $url . "?notfid=";
}
Sql::query("update notf set url=concat(?,id) where id=?", 'si', array(&$url, &$nid));
return $nid;
}
示例3: array
}
$User->set_user_lang(find_require_dir(PATH_TO_ROOT . '/lang/', $user_lang));
$LANG = array();
require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/main.php';
require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/errors.php';
$Cache->load('day');
if (gmdate_format('j', time(), TIMEZONE_SITE) != $_record_day && !empty($_record_day)) {
import('io/filesystem/file');
$lock_file = new File(PATH_TO_ROOT . '/cache/changeday_lock');
if (!$lock_file->exists()) {
$lock_file->write('');
$lock_file->flush();
}
$lock_file->lock(false);
$yesterday_timestamp = time() - 86400;
if ((int) $Sql->query("\n\t SELECT COUNT(*)\n FROM " . DB_TABLE_STATS . "\n WHERE stats_year = '" . gmdate_format('Y', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n stats_month = '" . gmdate_format('m', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n stats_day = '" . gmdate_format('d', $yesterday_timestamp, TIMEZONE_SYSTEM) . "'", __LINE__, __FILE__) == 0) {
$Cache->generate_file('day');
require_once PATH_TO_ROOT . '/kernel/changeday.php';
change_day();
}
$lock_file->close();
}
define('MODULE_NAME', get_module_name());
if (isset($MODULES[MODULE_NAME])) {
if ($MODULES[MODULE_NAME]['activ'] == 0) {
$Errorh->handler('e_unactivated_module', E_USER_REDIRECT);
} else {
if (!$User->check_auth($MODULES[MODULE_NAME]['auth'], ACCESS_MODULE)) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
}
示例4: action_create_table
function action_create_table($id_cloud, $json)
{
$data = Sql::selectOne('cloud', 'id = ?', $id_cloud);
if ($data) {
$e = json_decode($json);
if (count($e->columns) < 1) {
return json_encode(array('success' => false));
}
Sql::query('CREATE TABLE ' . $data['uid'] . '.' . $e->name . ' (idazertyuiop INT(6))');
for ($i = 0; $i < count($e->columns); $i++) {
if ($e->columns[$i]->extra == "AUTO_INCREMENT") {
Sql::query('ALTER TABLE ' . $data['uid'] . '.' . $e->name . ' ADD ' . $e->columns[$i]->name . ' ' . $e->columns[$i]->type . ' AUTO_INCREMENT PRIMARY KEY');
} else {
if ($e->columns[$i]->extra == "NOT NULL") {
Sql::query('ALTER TABLE ' . $data['uid'] . '.' . $e->name . ' ADD ' . $e->columns[$i]->name . ' ' . $e->columns[$i]->type . ' NOT NULL');
} else {
if ($e->columns[$i]->extra == "CURRENT_TIMESTAMP") {
Sql::query('ALTER TABLE ' . $data['uid'] . '.' . $e->name . ' ADD ' . $e->columns[$i]->name . ' ' . $e->columns[$i]->type . ' DEFAULT CURRENT_TIMESTAMP');
} else {
Sql::query('ALTER TABLE ' . $data['uid'] . '.' . $e->name . ' ADD ' . $e->columns[$i]->name . ' ' . $e->columns[$i]->type . '');
}
}
}
}
Sql::query('ALTER TABLE ' . $data['uid'] . '.' . $e->name . ' DROP idazertyuiop');
return json_encode(array('success' => true));
} else {
return json_encode(array('success' => false));
}
}
示例5: q
public static function q($query, $param_array = array())
{
$conq = Sqle::convQuery($query, $param_array);
return Sql::query($conq[0], $conq[1], getrefarr($conq[2]));
}