本文整理汇总了PHP中Sql_fetch_Row函数的典型用法代码示例。如果您正苦于以下问题:PHP Sql_fetch_Row函数的具体用法?PHP Sql_fetch_Row怎么用?PHP Sql_fetch_Row使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Sql_fetch_Row函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
$total = count($admins);
$found = $total;
$ls = new WebblerListing($GLOBALS['I18N']->get('Administrators'));
foreach ($admins as $adminid => $adminname) {
$ls->addElement($adminname);
#,PageUrl2("admin",$GLOBALS['I18N']->get('Show'),"id=".$adminid));
}
print $ls->display();
return;
} else {
if (!$find) {
$result = Sql_query('SELECT count(*) FROM ' . $tables['admin']);
} else {
$result = Sql_query('SELECT count(*) FROM ' . $tables['admin'] . " where loginname like \"%{$find}%\" or email like \"%{$find}%\"");
}
$totalres = Sql_fetch_Row($result);
$total = $totalres[0];
}
print '<p class="info">' . $total . ' ' . $GLOBALS['I18N']->get('Administrators');
print $find ? ' ' . $GLOBALS['I18N']->get('found') . '</p>' : '</p>';
$paging = '';
if ($total > MAX_USER_PP) {
$paging = simplePaging("admins{$remember_find}", $start, $total, MAX_USER_PP, $GLOBALS['I18N']->get('Administrators'));
}
$limit = '';
if ($total > MAX_USER_PP) {
if (isset($start) && $start) {
$limit = "limit {$start}," . MAX_USER_PP;
} else {
$limit = 'limit 0,50';
$start = 0;
示例2: getUserConfig
function getUserConfig($item, $userid = 0)
{
global $default_config, $tables, $domain, $website;
$hasconf = Sql_Table_Exists($tables["config"]);
$value = '';
if ($hasconf) {
$query = 'select value,editable from ' . $tables['config'] . ' where item = ?';
$req = Sql_Query_Params($query, array($item));
if (!Sql_Num_Rows($req)) {
if (array_key_exists($item, $default_config)) {
$value = $default_config[$item]['value'];
}
} else {
$row = Sql_fetch_Row($req);
$value = $row[0];
if ($row[1] == 0) {
$GLOBALS['noteditableconfig'][] = $item;
}
}
}
# if this is a subpage item, and no value was found get the global one
if (!$value && strpos($item, ":") !== false) {
list($a, $b) = explode(":", $item);
$value = getUserConfig($a, $userid);
}
if ($userid) {
$query = 'select uniqid, email from ' . $tables['user'] . ' where id = ?';
$rs = Sql_Query_Params($query, array($userid));
$user_req = Sql_Fetch_Row($rs);
$uniqid = $user_req[0];
$email = $user_req[1];
# parse for placeholders
# do some backwards compatibility:
# hmm, reverted back to old system
$url = getConfig("unsubscribeurl");
$sep = strpos($url, '?') !== false ? '&' : '?';
$value = str_ireplace('[UNSUBSCRIBEURL]', $url . $sep . 'uid=' . $uniqid, $value);
$url = getConfig("confirmationurl");
$sep = strpos($url, '?') !== false ? '&' : '?';
$value = str_ireplace('[CONFIRMATIONURL]', $url . $sep . 'uid=' . $uniqid, $value);
$url = getConfig("preferencesurl");
$sep = strpos($url, '?') !== false ? '&' : '?';
$value = str_ireplace('[PREFERENCESURL]', $url . $sep . 'uid=' . $uniqid, $value);
$value = str_ireplace('[EMAIL]', $email, $value);
$value = parsePlaceHolders($value, getUserAttributeValues($email));
}
$value = str_ireplace('[SUBSCRIBEURL]', getConfig("subscribeurl"), $value);
$value = preg_replace('/\\[DOMAIN\\]/i', $domain, $value);
#@ID Should be done only in one place. Combine getConfig and this one?
$value = preg_replace('/\\[WEBSITE\\]/i', $website, $value);
if ($value == "0") {
$value = "false";
} elseif ($value == "1") {
$value = "true";
}
return $value;
}
示例3: Sql_query
$subselect .= ' !confirmed ';
} else {
$subselect .= ' blacklisted';
}
} else {
$searchdone = 0;
}
$listquery = "select {$tables['user']}.email,{$tables['user']}.id,{$findfield},{$tables['user']}.confirmed from " . $table_list . ' ' . $subselect;
$count = Sql_query('SELECT count(*) FROM ' . $table_list . ' ' . $subselect);
$unconfirmedcount = Sql_query('SELECT count(*) FROM ' . $table_list . ' where !confirmed');
}
$delete_message = '<br />' . $GLOBALS['I18N']->get('Delete will delete user and all listmemberships') . '<br />';
}
$totalres = Sql_fetch_Row($unconfirmedcount);
$totalunconfirmed = $totalres[0];
$totalres = Sql_fetch_Row($count);
$total = $totalres[0];
if ($start > $total) {
$start = 0;
}
if (!empty($delete) && isSuperUser()) {
# delete the index in delete
$action_result = $GLOBALS['I18N']->get('deleting') . " {$delete} ..\n";
deleteUser($delete);
$action_result .= '..' . $GLOBALS['I18N']->get('Done') . '<br/><hr/>';
$previous_search = '';
if (!$find == '') {
$previous_search = "&start={$start}&find={$find}&findby={$findby}";
}
$_SESSION['action_result'] = $action_result;
Redirect("users{$previous_search}");
示例4: connectRemote
if ($new || !$new && $_POST["overwrite"]) {
# now check for attributes and list membership
connectRemote();
$useratt = array();
$req = Sql_Query("select * from {$remote_tables["user_attribute"]},\n {$remote_tables["attribute"]} where {$remote_tables["user_attribute"]}.attributeid =\n {$remote_tables["attribute"]}.id and {$remote_tables["user_attribute"]}.userid = {$user['0']}");
while ($att = Sql_Fetch_Array($req)) {
$value = "";
switch ($att["type"]) {
case "select":
case "radio":
$valreq = Sql_Fetch_Row_Query(sprintf('select name from %slistattr_%s where id = %d', $_POST["remote_prefix"], $att["tablename"], $att["value"]));
$value = $valreq[0];
break;
case "checkboxgroup":
$valreq = Sql_Query(sprintf('select name from %slistattr_%s where id in (%s)', sql_escape($_POST["remote_prefix"]), $att["tablename"], $att["value"]));
while ($vals = Sql_fetch_Row($valreq)) {
$value .= $vals[0] . ',';
}
break;
}
$att["displayvalue"] = $value;
array_push($useratt, $att);
}
$userlists = array();
$userlists = array_merge($_POST["lists"], $userlists);
if ($_POST["copyremotelists"]) {
$req = Sql_Query("select * from {$remote_tables["listuser"]},\n {$remote_tables["list"]} where {$remote_tables["listuser"]}.listid =\n {$remote_tables["list"]}.id and {$remote_tables["listuser"]}.userid = {$user['0']}");
while ($list = Sql_Fetch_Array($req)) {
# print $list["name"]."<br/>";
array_push($userlists, $list);
}