本文整理汇总了PHP中Sql_Fetch_Array_query函数的典型用法代码示例。如果您正苦于以下问题:PHP Sql_Fetch_Array_query函数的具体用法?PHP Sql_Fetch_Array_query怎么用?PHP Sql_Fetch_Array_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Sql_Fetch_Array_query函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ob_end_clean
print $ls->tabDelimited();
}
print $ls->display();
return;
}
if ($download) {
ob_end_clean();
# header("Content-type: text/plain");
header('Content-type: text/csv');
ob_start();
}
if (empty($start)) {
print '<p>' . PageLinkButton('mviews&dl=true&id=' . $id . '&start=' . $start, $GLOBALS['I18N']->get('Download as CSV file')) . '</p>';
}
#print '<h3>'.$GLOBALS['I18N']->get('View Details for a Message').'</h3>';
$messagedata = Sql_Fetch_Array_query("SELECT * FROM {$tables['message']} where id = {$id} {$subselect}");
print '<table class="mviewsDetails">
<tr><td>' . $GLOBALS['I18N']->get('Subject') . '<td><td>' . $messagedata['subject'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Entered') . '<td><td>' . $messagedata['entered'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Sent') . '<td><td>' . $messagedata['sent'] . '</td></tr>
</table><hr/>';
if ($download) {
header('Content-disposition: attachment; filename="phpList Message open statistics for ' . $messagedata['subject'] . '.csv"');
}
$ls = new WebblerListing(ucfirst($GLOBALS['I18N']->get('Open statistics')));
$req = Sql_Query(sprintf('select um.userid
from %s um,%s msg where um.messageid = %d and um.messageid = msg.id and um.viewed is not null %s
group by userid', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['message'], $id, $subselect));
$total = Sql_Affected_Rows();
if (isset($start) && $start > 0) {
$listing = sprintf($GLOBALS['I18N']->get("Listing user %d to %d"), $start, $start + MAX_USER_PP);
示例2: WebblerListing
break;
case 'none':
default:
print $GLOBALS['I18N']->get('You do not have access to this page');
return;
break;
}
$ls = new WebblerListing($GLOBALS['I18N']->get('User Click Statistics'));
if ($linkid) {
$urldata = Sql_Fetch_Array_Query(sprintf('select url from %s where linkid = %d', $GLOBALS['tables']['linktrack'], $linkid));
}
if ($msgid) {
$messagedata = Sql_Fetch_Array_query("SELECT * FROM {$tables['message']} where id = {$msgid} {$subselect}");
}
if ($userid) {
$userdata = Sql_Fetch_Array_query("SELECT * FROM {$tables['user']} where id = {$userid} {$subselect}");
}
if ($linkid && $msgid) {
print '<h1>' . $GLOBALS['I18N']->get('User Click Details for a URL in a message');
print ' ' . PageLink2('uclicks&id=' . $linkid, $urldata['url']);
print '</h1>';
print '<table>
<tr><td>' . $GLOBALS['I18N']->get('Subject') . '<td><td>' . PageLink2('mclicks&id=' . $msgid, $messagedata['subject']) . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Entered') . '<td><td>' . $messagedata['entered'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Sent') . '<td><td>' . $messagedata['sent'] . '</td></tr>
</table><hr/>';
$req = Sql_Query(sprintf('select user.email,user.id as userid,firstclick,date_format(latestclick,
"%%e %%b %%Y %%H:%%i") as latestclick,sum(clicked) as numclicks from %s as linktrack, %s as user where linktrack.userid = user.id
and linktrack.url = "%s" and linktrack.messageid = %d
and linktrack.clicked group by linktrack.userid', $GLOBALS['tables']['linktrack'], $GLOBALS['tables']['user'], $urldata['url'], $msgid));
} elseif ($userid && $msgid) {
示例3: set_time_limit
$GLOBALS["wait"] = $batch_period;
return;
}
$userid = $userdata[0];
# id of the user
$some = 1;
set_time_limit(120);
# check if we have been "killed"
$alive = checkLock($send_process_id);
if ($alive) {
keepLock($send_process_id);
} else {
ProcessError($GLOBALS['I18N']->get('Process Killed by other process'));
}
# check if the message we are working on is still there and in process
$status = Sql_Fetch_Array_query("select id,status from {$tables['message']} where id = {$messageid}");
if (!$status['id']) {
ProcessError($GLOBALS['I18N']->get('Message I was working on has disappeared'));
} elseif ($status['status'] != 'inprocess') {
ProcessError($GLOBALS['I18N']->get('Sending of this message has been suspended'));
}
flush();
# check whether the user has already received the message
$um = Sql_query("select entered from {$tables['usermessage']} where userid = {$userdata['0']} and messageid = {$messageid}");
if (!Sql_Affected_Rows()) {
if ($script_stage < 4) {
$script_stage = 4;
}
# we know a user
$someusers = 1;
$users = Sql_query("select id,email,uniqid,htmlemail,rssfrequency,confirmed,blacklisted from {$tables['user']} where id = {$userid}");
示例4: unsubscribePage
//.........这里部分代码省略.........
#0013076: Blacklisting posibility for unknown users
if ($blacklistRequest && !empty($email)) {
addUserToBlacklist($email, $_POST['unsubscribereason']);
addSubscriberStatistics('blacklist', 1);
$res .= '<h3>' . $GLOBALS['strUnsubscribedNoConfirm'] . '</h3>';
} else {
$res .= $GLOBALS['strNoListsFound'];
#'Error: '.$GLOBALS["strUserNotFound"];
logEvent('Request to unsubscribe non-existent user: ' . substr($email, 0, 150));
}
} else {
$subscriptions = array();
$listsreq = Sql_Query(sprintf('select listid from %s where userid = %d', $GLOBALS['tables']['listuser'], $userid));
while ($row = Sql_Fetch_Row($listsreq)) {
array_push($subscriptions, $row[0]);
}
## 17753 - do not actually remove the list-membership when unsubscribing
# $result = Sql_query(sprintf('delete from %s where userid = %d',$tables["listuser"],$userid));
$lists = ' * ' . $GLOBALS['strAllMailinglists'] . "\n";
if (empty($isBlackListed)) {
// only process when not already marked as blacklisted
# add user to blacklist
addUserToBlacklist($email, nl2br(strip_tags($_POST['unsubscribereason'])));
addUserHistory($email, 'Unsubscription', "Unsubscribed from {$lists}");
$unsubscribemessage = str_replace('[LISTS]', $lists, getUserConfig("unsubscribemessage:{$id}", $userid));
sendMail($email, getUserConfig("unsubscribesubject:{$id}"), stripslashes($unsubscribemessage), system_messageheaders($email), '', true);
$reason = $_POST['unsubscribereason'] ? "Reason given:\n" . stripslashes($_POST['unsubscribereason']) : 'No Reason given';
sendAdminCopy('List unsubscription', $email . " has unsubscribed\n{$reason}", $subscriptions);
addSubscriberStatistics('unsubscription', 1);
}
}
if ($userid) {
$res .= '<h3>' . $GLOBALS['strUnsubscribeDone'] . '</h3>';
}
#0013076: Blacklisting posibility for unknown users
//if ($blacklistRequest) {
//$res .= '<h3>'.$GLOBALS["strYouAreBlacklisted"] ."</h3>";
//}
$res .= $GLOBALS['PoweredBy'] . '</p>';
$res .= $GLOBALS['pagedata']['footer'];
return $res;
} elseif (isset($_POST['unsubscribe']) && !is_email($email) && !empty($email)) {
$msg = '<span class="error">' . $GLOBALS['strEnterEmail'] . '</span><br>';
}
$res .= '<h3>' . $GLOBALS['strUnsubscribeInfo'] . '</h3>' . $msg . '<form method="post" action=""><input type="hidden" name="p" value="unsubscribe" />';
if (!isset($_POST['email']) || empty($email)) {
$res .= '<p>' . $GLOBALS['strEnterEmail'] . ': <input type="text" name="email" value="' . $email . '" size="40" /></p>';
} else {
$res .= '<p><input type="hidden" name="email" value="' . $email . '" />' . $GLOBALS['strEmail'] . ': ' . $email . '</p>';
}
if (!$email) {
$res .= '<input type="submit" name="unsubscribe" value="' . $GLOBALS['strContinue'] . '"></form>';
$res .= $GLOBALS['PoweredBy'];
$res .= $GLOBALS['pagedata']['footer'];
return $res;
}
$current = Sql_Fetch_Array_query(sprintf('select list.id as listid,user.uniqid as userhash, user.password as password
from %s as list,%s as listuser,%s as user where list.id = listuser.listid and user.id = listuser.userid and user.email = "%s"', $tables['list'], $tables['listuser'], $tables['user'], sql_escape($email)));
$some = $current['listid'];
if (ASKFORPASSWORD && !empty($user['password'])) {
# it is safe to link to the preferences page, because it will still ask for
# a password
$hash = $current['userhash'];
} elseif (isset($_GET['uid']) && $_GET['uid'] == $current['userhash']) {
# they got to this page from a link in an email
$hash = $current['userhash'];
} else {
$hash = '';
}
$finaltext = $GLOBALS['strUnsubscribeFinalInfo'];
$pref_url = getConfig('preferencesurl');
$sep = strpos($pref_url, '?') !== false ? '&' : '?';
$finaltext = str_ireplace('[preferencesurl]', $pref_url . $sep . 'uid=' . $hash, $finaltext);
if (!$some) {
#0013076: Blacklisting posibility for unknown users
if (!$blacklistRequest) {
$res .= '<b>' . $GLOBALS['strNoListsFound'] . '</b></ul>';
}
$res .= '<p><input type=submit value="' . $GLOBALS['strUnsubscribe'] . '">';
} else {
if ($blacklistRequest) {
$res .= $GLOBALS['strExplainBlacklist'];
} elseif (!UNSUBSCRIBE_JUMPOFF) {
list($r, $c) = explode(',', getConfig('textarea_dimensions'));
if (!$r) {
$r = 5;
}
if (!$c) {
$c = 65;
}
$res .= $GLOBALS['strUnsubscribeRequestForReason'];
$res .= sprintf('<br/><textarea name="unsubscribereason" cols="%d" rows="%d" wrap="virtual"></textarea>', $c, $r) . $finaltext;
}
$res .= '<p><input type=submit name="unsubscribe" value="' . $GLOBALS['strUnsubscribe'] . '"></p>';
}
$res .= '</form>';
$res .= '<p>' . $GLOBALS['PoweredBy'] . '</p>';
$res .= $GLOBALS['pagedata']['footer'];
return $res;
}
示例5: unsubscribePage
function unsubscribePage($id)
{
$pagedata = pageData($id);
if (isset($pagedata['language_file']) && is_file(dirname(__FILE__) . '/texts/' . $pagedata['language_file'])) {
@(include dirname(__FILE__) . '/texts/' . $pagedata['language_file']);
}
global $tables;
$res .= '<title>' . $GLOBALS["strUnsubscribeTitle"] . '</title>';
$res = $pagedata["header"];
if (isset($_GET["uid"])) {
$req = Sql_Query("select * from {$tables['user']} where uniqid = \"" . $_GET["uid"] . "\"");
$userdata = Sql_Fetch_Array($req);
$email = $userdata["email"];
if (UNSUBSCRIBE_JUMPOFF) {
$_POST["unsubscribe"] = 1;
$_POST["email"] = $email;
$_POST["unsubscribereason"] = '"Jump off" set, reason not requested';
}
}
if (isset($_POST["unsubscribe"]) && (isset($_POST["email"]) || isset($_POST["unsubscribeemail"])) && isset($_POST["unsubscribereason"])) {
if (isset($_POST["email"])) {
$email = trim($_POST["email"]);
} else {
$email = $_POST["unsubscribeemail"];
}
$query = Sql_Fetch_Row_Query("select id,email from {$tables["user"]} where email = \"{$email}\"");
$userid = $query[0];
$email = $query[1];
if (!$userid) {
$res .= 'Error: ' . $GLOBALS["strUserNotFound"];
logEvent("Request to unsubscribe non-existent user: " . substr($_POST["email"], 0, 150));
} else {
$result = Sql_query("delete from {$tables["listuser"]} where userid = \"{$userid}\"");
$lists = " * " . $GLOBALS["strAllMailinglists"] . "\n";
# add user to blacklist
addUserToBlacklist($email, nl2br(strip_tags($_POST['unsubscribereason'])));
addUserHistory($email, "Unsubscription", "Unsubscribed from {$lists}");
$unsubscribemessage = ereg_replace("\\[LISTS\\]", $lists, getUserConfig("unsubscribemessage", $userid));
sendMail($email, getConfig("unsubscribesubject"), stripslashes($unsubscribemessage), system_messageheaders($email));
$reason = $_POST["unsubscribereason"] ? "Reason given:\n" . stripslashes($_POST["unsubscribereason"]) : "No Reason given";
sendAdminCopy("List unsubscription", $email . " has unsubscribed\n{$reason}");
addSubscriberStatistics('unsubscription', 1);
}
if ($userid) {
$res .= '<h1>' . $GLOBALS["strUnsubscribeDone"] . "</h1><P>";
}
$res .= $GLOBALS["PoweredBy"] . '</p>';
$res .= $pagedata["footer"];
return $res;
} elseif (isset($_POST["unsubscribe"]) && !$_POST["unsubscribeemail"]) {
$msg = '<span class="error">' . $GLOBALS["strEnterEmail"] . "</span><br>";
} elseif (!empty($_GET["email"])) {
$email = trim($_GET["email"]);
} else {
if (isset($_REQUEST["email"])) {
$email = $_REQUEST["email"];
} elseif (isset($_REQUEST['unsubscribeemail'])) {
$email = $_REQUEST['unsubscribeemail'];
} elseif (!isset($email)) {
$email = '';
}
}
if (!isset($msg)) {
$msg = '';
}
$res .= '<b>' . $GLOBALS["strUnsubscribeInfo"] . '</b><br>' . $msg . formStart();
$res .= '<table>
<tr><td>' . $GLOBALS["strEnterEmail"] . ':</td><td colspan=3><input type=text name="unsubscribeemail" value="' . $email . '" size=40></td></tr>
</table>';
if (!$email) {
$res .= "<input type=submit name=unsubscribe value=\"{$GLOBALS['strContinue']}\"></form>\n";
$res .= $GLOBALS["PoweredBy"];
$res .= $pagedata["footer"];
return $res;
}
$current = Sql_Fetch_Array_query("SELECT list.id as listid,user.uniqid as userhash, user.password as password FROM {$tables['list']} as list,{$tables['listuser']} as listuser,{$tables['user']} as user where list.id = listuser.listid and user.id = listuser.userid and user.email = \"{$email}\"");
$some = $current["listid"];
if (ASKFORPASSWORD && !empty($user['password'])) {
# it is safe to link to the preferences page, because it will still ask for
# a password
$hash = $current["userhash"];
} elseif (isset($_GET['uid']) && $_GET['uid'] == $current['userhash']) {
# they got to this page from a link in an email
$hash = $current['userhash'];
} else {
$hash = '';
}
$finaltext = $GLOBALS["strUnsubscribeFinalInfo"];
$pref_url = getConfig("preferencesurl");
$sep = ereg('\\?', $pref_url) ? '&' : '?';
$finaltext = eregi_replace('\\[preferencesurl\\]', $pref_url . $sep . 'uid=' . $hash, $finaltext);
if (!$some) {
$res .= "<b>" . $GLOBALS["strNoListsFound"] . "</b></ul>";
$res .= '<p><input type=submit value="' . $GLOBALS["strResubmit"] . '">';
} else {
list($r, $c) = explode(",", getConfig("textarea_dimensions"));
if (!$r) {
$r = 5;
}
if (!$c) {
//.........这里部分代码省略.........