本文整理汇总了PHP中sql_fieldrow函数的典型用法代码示例。如果您正苦于以下问题:PHP sql_fieldrow函数的具体用法?PHP sql_fieldrow怎么用?PHP sql_fieldrow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sql_fieldrow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$topic = request_var('topic', 0);
$important = request_var('important', 0);
$sql = 'SELECT *
FROM _forum_topics
WHERE topic_id = ?';
if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) {
fatal_error();
}
$sql_important = ($important) ? ', topic_important = 1' : '';
$sql = 'UPDATE _forum_topics
SET topic_color = ?, topic_announce = 1' . $sql_important . '
WHERE topic_id = ?';
sql_query(sql_filter($sql, 'E1CB39', $topic));
return _pre('El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido anunciado.', true);
}
示例2: create
private function create() {
$v = _request(array('username' => ''));
if (_empty($v)) return;
$v->username = get_username_base($v->username);
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if (!$result = sql_fieldrow(sql_filter($sql, $v->username))) {
return;
}
$sql = 'SELECT *
FROM _banlist
WHERE ban_userid = ?';
if (!$ban = sql_fieldrow(sql_filter($sql, $result['user_id']))) {
$insert = array(
'ban_userid' => $result['user_id']
);
sql_insert('banlist', $insert);
$sql = 'DELETE FROM _sessions
WHERE session_user_id = ?';
sql_query(sql_filter($sql, $result['user_id']));
echo 'El usuario ' . $result['username'] . ' fue bloqueado.';
}
return true;
}
示例3: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$topic_id = request_var('topic_id', 0);
if (!$topic_id) {
fatal_error();
}
$sql = 'SELECT *
FROM _forum_topics
WHERE topic_id = ?';
if (!$data = sql_fieldrow(sql_filter($sql, $topic_id))) {
fatal_error();
}
$title = ucfirst(strtolower($data['topic_title']));
$sql = 'UPDATE _forum_topics SET topic_title = ?
WHERE topic_id = ?';
sql_query(sql_filter($sql, $title, $topic_id));
return _pre($data['topic_title'] . ' > ' . $title, true);
}
示例4: create
private function create() {
$code = request_var('code', '');
$vname = request_var('vname', '');
if (!empty($code)) {
$sql = 'SELECT *
FROM _artists_video
WHERE video_a = ?
AND video_code = ?';
if (sql_fieldrow(sql_filter($sql, $this->object['ub'], $code))) {
$code = '';
}
}
if (!empty($code)) {
$code = get_yt_code($code);
}
if (!empty($code)) {
$insert = array(
'video_a' => $this->object['ub'],
'video_name' => $vname,
'video_code' => $code,
'video_added' => time()
);
sql_insert('artists_video', $insert);
$sql = 'UPDATE _artists SET a_video = a_video + 1
WHERE ub = ?';
sql_query(sql_filter($sql, $this->object['ub']));
}
return redirect(_page());
}
示例5: remove
private function remove() {
$v = _request(array('event' => 0));
if (_empty($v)) {
return;
}
$sql = 'SELECT *
FROM _events
WHERE id = ?';
if (!$row = sql_fieldrow(sql_filter($sql, $event))) {
_pre('El evento no existe.', true);
}
$e_artist = explode(nr(), $artist);
foreach ($e_artist as $row) {
$subdomain = get_subdomain($row);
$sql = 'SELECT *
FROM _artists
WHERE subdomain = ?';
if ($a_row = sql_fieldrow(sql_filter($sql, $subdomain))) {
$sql = 'DELETE FROM _artists_events
WHERE a_artist = ?
AND a_event = ?';
sql_query(sql_filter($sql, $a_row['ub'], $event));
}
}
return redirect(s_link('events', $row['event_alias']));
}
示例6: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return;
}
$this->id = request_var('msg_id', 0);
$sql = 'SELECT *
FROM _forum_topics
WHERE topic_id = ?';
if (!$this->object = sql_fieldrow(sql_filter($sql, $this->id))) {
fatal_error();
}
$this->object = (object) $this->object;
$this->object->new_value = ($this->object->topic_featured) ? 0 : 1;
topic_feature($this->id, $this->object->new_value);
$sql_insert = array(
'bio' => $user->d('user_id'),
'time' => time(),
'ip' => $user->ip,
'action' => 'feature',
'old' => $this->object->topic_featured,
'new' => $this->object->new_value
);
sql_insert('log_mod', $sql_insert);
return redirect(s_link('topic', $this->id));
}
示例7: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username = request_var('username', '');
$password = request_var('password', '');
$username = get_username_base($username);
$sql = 'SELECT user_id, username
FROM _members
WHERE username_base = ?';
if (!$userdata = sql_fieldrow(sql_filter($sql, $username))) {
fatal_error();
}
$sql = 'UPDATE _members SET user_password = ?
WHERE user_id = ?';
sql_query(sql_filter($sql, HashPassword($password), $userdata['user_id']));
return _pre('La contraseña de ' . $userdata['username'] . ' fue actualizada.', true);
}
示例8: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username = request_var('username', '');
if (empty($username)) {
fatal_error();
}
$username = get_username_base($username);
$sql = 'SELECT user_id
FROM _members
WHERE username_base = ?';
if (!$row = sql_fieldrow(sql_filter($sql, $username))) {
fatal_error();
}
$sql = 'DELETE FROM _members_unread
WHERE user_id = ?
AND element <> ?';
sql_query(sql_filter($sql, $row['user_id'], 16));
return _pre('Deleted', true);
}
示例9: create
private function create() {
$v = _request(array('event' => 0));
if (_empty($v)) {
return;
}
$sql = 'SELECT id, event_alias
FROM _events
WHERE id = ?';
if (!$event = sql_fieldrow(sql_filter($sql, $v->event))) {
return;
}
$sql = 'SELECT ub
FROM _artists_events
WHERE a_artist = ?
AND a_event = ?';
if (sql_field(sql_filter($sql, $this->object['ub'], $v->event))) {
return;
}
$sql_insert = array(
'a_artist' => $this->object['ub'],
'a_event' => $event['id']
);
sql_insert('artists_events', $sql_insert);
return redirect(s_link('events', $event['event_alias']));
}
示例10: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username = request_var('username', '');
$username = get_username_base($username);
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if (!$userdata = sql_fieldrow(sql_filter($sql, $username))) {
fatal_error();
}
$ary_sql = array(
'DELETE FROM _members WHERE user_id = ?',
'DELETE FROM _banlist WHERE ban_userid = ?',
'DELETE FROM _members_group WHERE user_id = ?',
'DELETE FROM _members_iplog WHERE log_user_id = ?',
'DELETE FROM _members_ref_invite WHERE invite_uid = ?',
'DELETE FROM _members_unread WHERE user_id = ?',
'DELETE FROM _poll_voters WHERE vote_user_id = ?',
'DELETE FROM _artists_auth WHERE user_id = ?',
'DELETE FROM _artists_viewers WHERE user_id = ?',
'DELETE FROM _artists_voters WHERE user_id = ?',
'DELETE FROM _dl_voters WHERE user_id = ?',
'UPDATE _members_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _news_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _artists_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _dl_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _events_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _forum_posts SET poster_id = 1 WHERE poster_id = ?',
'UPDATE _forum_topics SET topic_poster = 1 WHERE topic_poster = ?'
);
$sql = w();
foreach ($ary_sql as $row) {
$sql[] = sql_filter($row, $userdata['user_id']);
}
$ary_sql = array(
'DELETE FROM _members_ban WHERE user_id = ? OR banned_user = ?',
'DELETE FROM _members_friends WHERE user_id = ? OR buddy_id = ?',
'DELETE FROM _members_ref_assoc WHERE ref_uid = ? OR ref_orig = ?',
'DELETE FROM _members_viewers WHERE viewer_id = ? OR user_id = ?',
);
foreach ($ary_sql as $row) {
$sql[] = sql_filter($row, $userdata['user_id'], $userdata['user_id']);
}
sql_query($sql);
return _pre('El registro de <strong>' . $userdata['username'] . '</strong> fue eliminado.', true);
}
示例11: _home
public function _home() {
global $config, $user, $cache;
if ($submit) {
return false;
}
$bot_name = request_var('bot_name', '');
$bot_agent = request_var('bot_agent', '');
$bot_ip = request_var('bot_ip', '');
$bot_base = get_username_base($bot_name);
$sql = 'SELECT *
FROM _bots
WHERE bot_name = ?';
$insert = true;
if ($row = sql_fieldrow(sql_filter($sql, $bot_name))) {
$insert = false;
if ($row['bot_ip'] != $bot_ip) {
$sql = 'UPDATE _bots SET bot_ip = ?
WHERE bot_id = ?';
sql_query(sql_filter($sql, $row['bot_ip'] . ',' . $bot_ip, $row['bot_id']));
}
}
if ($insert)
{
$insert_member = array(
'user_type' => 2,
'user_active' => 1,
'username' => $bot_name,
'username_base' => $bot_base,
'user_timezone' => -6.00,
'user_lang' => 'spanish'
);
$bot_id = sql_insert('members', $insert_member);
$insert_bot = array(
'bot_active' => 1,
'bot_name' => $bot_name,
'user_id' => $bot_id,
'bot_agent' => $bot_agent,
'bot_ip' => $bot_ip,
);
sql_insert('bots', $insert_bot);
}
$sql = "DELETE FROM _sessions
WHERE session_browser LIKE '%??%'";
sql_query(sql_filter($sql, $bot_name));
$cache->delete('bots');
return;
}
示例12: _home
public function _home() {
global $config, $user, $cache;
$submit2 = _button('submit2');
if (_button() || $submit2) {
$news_id = request_var('news_id', 0);
$sql = 'SELECT *
FROM _news
WHERE news_id = ?';
if (!$news_data = sql_fieldrow(sql_filter($sql, $news_id))) {
fatal_error();
}
if ($submit2) {
$post_subject = request_var('post_subject', '');
$post_desc = request_var('post_desc', '', true);
$post_message = request_var('post_text', '', true);
if (empty($post_desc) || empty($post_message)) {
_pre('Campos requeridos.', true);
}
$comments = new _comments();
$post_message = $comments->prepare($post_message);
$post_desc = $comments->prepare($post_desc);
//
$sql = 'UPDATE _news SET post_subject = ?, post_desc = ?, post_text = ?
WHERE news_id = ?';
sql_query(sql_filter($sql, $post_subject, $post_desc, $post_message, $news_id));
$cache->delete('news');
redirect(s_link('news', $news_id));
}
if (_button()) {
_style('edit', array(
'ID' => $news_data['news_id'],
'SUBJECT' => $news_data['post_subject'],
'DESC' => $news_data['post_desc'],
'TEXT' => $news_data['post_text'])
);
}
}
if (!_button()) {
_style('field');
}
return;
}
示例13: search_topic
function search_topic($topic_id) {
$result = false;
$sql = 'SELECT *
FROM _forum_topics
WHERE topic_id = ?';
if ($row = sql_fieldrow(sql_filter($sql, $topic_id))) {
$result = $row;
}
return $result;
}
示例14: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username1 = request_var('username1', '');
$username2 = request_var('username2', '');
if (empty($username1) || empty($username2)) {
fatal_error();
}
$username_base1 = get_username_base($username1);
$username_base2 = get_username_base($username2);
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if (!$userdata = sql_fieldrow(sql_filter($sql, $username_base1))) {
_pre('El usuario no existe.', true);
}
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if ($void = sql_fieldrow(sql_filter($sql, $username_base2))) {
_pre('El usuario ya existe.', true);
}
//
$sql = 'UPDATE _members SET username = ?, username_base = ?
WHERE user_id = ?';
sql_query(sql_filter($sql, $username2, $username_base2, $userdata['user_id']));
$emailer = new emailer();
$emailer->from('info');
$emailer->use_template('username_change', $config['default_lang']);
$emailer->email_address($userdata['user_email']);
$emailer->assign_vars(array(
'USERNAME' => $userdata['username'],
'NEW_USERNAME' => $username2,
'U_USERNAME' => s_link('m', $username_base2))
);
$emailer->send();
$emailer->reset();
redirect(s_link('m', $username_base2));
return;
}
示例15: _home
public function _home() {
global $config, $cache, $user;
if (!_button()) {
$sql = 'SELECT cat_id, cat_name
FROM _news_cat
ORDER BY cat_id';
$result = sql_rowset($sql);
foreach ($result as $i => $row) {
if (!$i) _style('categories');
_style('categories.row', array(
'CAT_ID' => $row['cat_id'],
'CAT_NAME' => $row['cat_name'])
);
}
return false;
}
$t = request_var('news_id', 0);
$f = request_var('cat_id', 0);
if (!$f || !$t) {
fatal_error();
}
//
$sql = 'SELECT *
FROM _news
WHERE news_id = ?';
if (!$tdata = sql_fieldrow(sql_filter($sql, $t))) {
fatal_error();
}
//
$sql = 'SELECT *
FROM _news_cat
WHERE cat_id = ?';
if (!$fdata = sql_fieldrow(sql_filter($sql, $f))) {
fatal_error();
}
//
$sql = 'UPDATE _news SET cat_id = ?
WHERE news_id = ?';
sql_query(sql_filter($sql, $f, $t));
return redirect(s_link('news', $t));
}