本文整理汇总了PHP中_mysqli_query函数的典型用法代码示例。如果您正苦于以下问题:PHP _mysqli_query函数的具体用法?PHP _mysqli_query怎么用?PHP _mysqli_query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_mysqli_query函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _mysqli_query
<span class="infotext">Select rotator, to add new rule. You can add as many rules as you want, for each rotator.</span>
</div>
</div>
<form class="form-inline" onsubmit="return false;" role="form" id="rule_form" method="post" action="">
<div class="row" style="margin-top:15px;">
<div class="col-xs-4">
<div class="form-group">
<img id="rules_loading" class="loading" src="/202-img/loader-small.gif" style="display:none;right: -20px;top: 10px;"/>
<label for="rotator_id" style="margin-right:5px;">Select rotator: </label>
<select class="form-control input-sm" name="rotator_id" style="min-width: 130px;">
<option value="0">--</option>
<?php
$mysql['user_id'] = $db->real_escape_string($_SESSION['user_id']);
$rotator_sql = "SELECT * FROM `202_rotators` WHERE `user_id`='" . $mysql['user_id'] . "' ORDER BY `name` ASC";
$rotator_result = _mysqli_query($rotator_sql);
while ($rotator_row = $rotator_result->fetch_array(MYSQL_ASSOC)) {
$html['rotator_name'] = htmlentities($rotator_row['name'], ENT_QUOTES, 'UTF-8');
$html['rotator_id'] = htmlentities($rotator_row['id'], ENT_QUOTES, 'UTF-8');
printf('<option value="%s">%s</option>', $html['rotator_id'], $html['rotator_name']);
}
?>
</select>
</div>
</div>
<div id="defaults_container" style="opacity:0.5">
<div class="col-xs-4">
<label for="default_type" class="col-xs-5 control-label">Defaults to: </label>
<label class="radio radio-inline">
<input type="radio" name="default_type" id="default_type1" value="campaign" data-toggle="radio" disabled checked="">
示例2: grab_timeframe
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php';
AUTH::require_user();
//set the timezone for the user, for entering their dates.
AUTH::set_timezone($_SESSION['user_timezone']);
//grab user time range preference
$time = grab_timeframe();
$mysql['to'] = $db->real_escape_string($time['to']);
$mysql['from'] = $db->real_escape_string($time['from']);
//show real or filtered clicks
$mysql['user_id'] = $db->real_escape_string($_SESSION['user_id']);
$user_sql = "SELECT user_pref_breakdown, user_pref_show, user_cpc_or_cpv FROM 202_users_pref WHERE user_id=" . $mysql['user_id'];
$user_result = _mysqli_query($user_sql, $dbGlobalLink);
//($user_sql);
$user_row = $user_result->fetch_assoc();
$breakdown = $user_row['user_pref_breakdown'];
if ($user_row['user_pref_show'] == 'all') {
$click_flitered = '';
}
if ($user_row['user_pref_show'] == 'real') {
$click_filtered = " AND click_filtered='0' ";
}
if ($user_row['user_pref_show'] == 'filtered') {
$click_filtered = " AND click_filtered='1' ";
}
if ($user_row['user_pref_show'] == 'filtered_bot') {
$click_filtered = " AND click_bot='1' ";
}
if ($user_row['user_pref_show'] == 'leads') {
$click_filtered = " AND click_lead='1' ";
示例3: get_c4_id
function get_c4_id($c4)
{
global $memcacheWorking, $memcache;
//only grab the first 350 charactesr of c4
$c4 = substr($c4, 0, 350);
if ($memcacheWorking) {
//get from memcached
$getc4 = $memcache->get(md5("c4-id" . $c4 . systemHash()));
if ($getc4) {
return $getc4;
} else {
$database = DB::getInstance();
$db = $database->getConnection();
$mysql['c4'] = $db->real_escape_string($c4);
$c4_sql = "SELECT c4_id FROM 202_tracking_c4 WHERE c4='" . $mysql['c4'] . "'";
$c4_result = _mysqli_query($c4_sql);
$c4_row = $c4_result->fetch_assoc();
if ($c4_row) {
//if this already exists, return the id for it
$c4_id = $c4_row['c4_id'];
$setID = $memcache->set(md5("c4-id" . $c4 . systemHash()), $c4_id, false);
return $c4_id;
} else {
$c4_sql = "INSERT INTO 202_tracking_c4 SET c4='" . $mysql['c4'] . "'";
$c4_result = _mysqli_query($c4_sql);
//($c4_sql);
$c4_id = $db->insert_id;
$setID = $memcache->set(md5("c4-id" . $c4 . systemHash()), $c4_id, false);
return $c4_id;
}
}
} else {
$database = DB::getInstance();
$db = $database->getConnection();
$mysql['c4'] = $db->real_escape_string($c4);
$c4_sql = "SELECT c4_id FROM 202_tracking_c4 WHERE c4='" . $mysql['c4'] . "'";
$c4_result = _mysqli_query($c4_sql);
$c4_row = $c4_result->fetch_assoc();
if ($c4_row) {
//if this already exists, return the id for it
$c4_id = $c4_row['c4_id'];
return $c4_id;
} else {
//else if this ip doesn't exist, insert the row and grab the id for it
$c4_sql = "INSERT INTO 202_tracking_c4 SET c4='" . $mysql['c4'] . "'";
$c4_result = _mysqli_query($c4_sql);
//($c4_sql);
$c4_id = $db->insert_id;
return $c4_id;
}
}
}
示例4: USING
$click_filtered = " AND click_lead='1' ";
}
if ($user_row['user_cpc_or_cpv'] == 'cpv') {
$cpv = true;
} else {
$cpv = false;
}
$info_sql = "\n\t\t\t\tSELECT \t202_aff_campaigns.aff_campaign_id,\n\t\t\t\t\t\t\taff_campaign_name,\n\t\t\t\t\t\t\taff_campaign_payout,\n\t\t\t\t\t\t\taff_network_name\n\t\t\t\t FROM \t202_summary_overview \n\t\t\t\t LEFT JOIN 202_aff_campaigns USING (aff_campaign_id) \n\t\t\t\t LEFT JOIN 202_aff_networks USING(aff_network_id) \n\t\t\t\t WHERE \t202_aff_networks.user_id='" . $mysql['user_id'] . "'\n\t\t\t\t AND \t202_aff_networks.aff_network_deleted = 0\n\t\t\t\t AND \t202_aff_campaigns.aff_campaign_deleted = 0 \n\t\t\t\t AND \t202_summary_overview.click_time >= " . $mysql['from'] . "\n\t\t\t\t AND \t202_summary_overview.click_time < " . $mysql['to'] . "\n\t\t\t\t AND \t\tlanding_page_id=0 \n\t\t\t\t GROUP BY aff_campaign_id \n\t\t\t\t ORDER BY 202_aff_networks.aff_network_name ASC,\n\t\t\t\t\t\t\t 202_aff_campaigns.aff_campaign_name ASC";
$info_result = _mysqli_query($info_sql);
//($info_sql);
while ($info_row = $info_result->fetch_array(MYSQL_ASSOC)) {
//mysql escape the vars
$mysql['aff_campaign_id'] = $db->real_escape_string($info_row['aff_campaign_id']);
$mysql['landing_page_id'] = $db->real_escape_string($info_row['landing_page_id']);
$click_sql = "\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(*) AS clicks,\n\t\t\t\t\tAVG(2c.click_cpc) AS avg_cpc,\n\t\t\t\t\tSUM(2c.click_lead) AS leads,\n\t\t\t\t\tSUM(2c.click_payout*2c.click_lead) AS income\n\t\t\t\tFROM\n\t\t\t\t\t202_clicks AS 2c\n\t\t\t\tWHERE\n\t\t\t\t\t2c.user_id='" . $mysql['user_id'] . "'\n\t\t\t\t\t{$click_filtered}\n\t\t\t\t\tAND 2c.aff_campaign_id='" . $mysql['aff_campaign_id'] . "'\n\t\t\t\t\tAND 2c.click_time > " . $mysql['from'] . "\n\t\t\t\t\tAND 2c.click_time <= " . $mysql['to'] . "\n\t\t\t\t\tAND 2c.click_alp=0\n\t\t\t";
$click_result = _mysqli_query($click_sql);
//($click_sql);
$click_row = $click_result->fetch_assoc();
//get the stats
$clicks = 0;
$clicks = $click_row['clicks'];
$total_clicks = $total_clicks + $clicks;
//avg cpc and cost
$avg_cpc = 0;
$avg_cpc = $click_row['avg_cpc'];
$cost = 0;
$cost = $clicks * $avg_cpc;
$total_cost = $total_cost + $cost;
$total_avg_cpc = @round($total_cost / $total_clicks, 5);
//leads
$leads = 0;
示例5: htmlentities
$html['user_pref_group_2'] = htmlentities($user_row['user_pref_group_2'], ENT_QUOTES, 'UTF-8');
$html['user_pref_group_3'] = htmlentities($user_row['user_pref_group_3'], ENT_QUOTES, 'UTF-8');
$html['user_pref_group_4'] = htmlentities($user_row['user_pref_group_4'], ENT_QUOTES, 'UTF-8');
if ($user_row['user_cpc_or_cpv'] == 'cpv') {
$cpv = true;
} else {
$cpv = false;
}
$summary_form = new ReportSummaryForm();
$summary_form->setDetails(array($user_row['user_pref_group_1'], $user_row['user_pref_group_2'], $user_row['user_pref_group_3'], $user_row['user_pref_group_4']));
$summary_form->setDetailsSort(array(ReportBasicForm::SORT_NAME));
$summary_form->setDisplayType(array(ReportBasicForm::DISPLAY_TYPE_TABLE));
$summary_form->setStartTime($mysql['from']);
$summary_form->setEndTime($mysql['to']);
$mysql['user_id'] = $db->real_escape_string($_SESSION['user_id']);
$info_result = _mysqli_query($summary_form->getQuery($mysql['user_id'], $user_row));
while ($row = $info_result->fetch_assoc()) {
$summary_form->addReportData($row);
}
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"GroupOverviewReport" . date("mdy") . ".csv\"");
header("Expires: 0");
header("Pragma: no-cache");
ReportBasicForm::echoCell("Group Overview Report for " . date("m/d/Y", strtotime($summary_form->getStartDate())) . " to " . date("m/d/Y", strtotime($summary_form->getEndDate())));
ReportBasicForm::echoRow();
ReportBasicForm::echoCell($summary_form->getRanOn());
ReportBasicForm::echoRow();
ReportBasicForm::echoRow();
if (count($summary_form->getReportData()->getChildArrayBySort()) > 0) {
$summary_form->getExportRowHeaderHtml();
/* @var $summary_form_detail_1 Form */
示例6: salt_user_pass
}
if ($_POST['user_pass'] == '') {
$error['user_pass'] .= '<div class="error">You must type verify your password</div>';
}
if (strlen($_POST['user_pass']) < 6 or strlen($_POST['user_pass']) > 15) {
$error['user_pass'] .= '<div class="error">Passwords must be 6 to 15 characters long</div>';
}
if ($_POST['user_pass'] != $_POST['verify_user_pass']) {
$error['user_pass'] .= '<div class="error">Your passwords did not match, please try again</div>';
}
if (!$error) {
$user_pass = salt_user_pass($_POST['user_pass']);
$mysql['user_pass'] = $db->real_escape_string($user_pass);
$mysql['user_id'] = $db->real_escape_string($user_row['user_id']);
$user_sql = "UPDATE \t202_users\n\t\t\t\t\t\t SET\t\tuser_pass='" . $mysql['user_pass'] . "',\n\t\t\t\t\t\t\t\t\tuser_pass_time='0'\n\t\t\t\t\t\t WHERE\tuser_id='" . $mysql['user_id'] . "'";
$user_result = _mysqli_query($user_sql);
$success = true;
}
}
$html['user_name'] = htmlentities($user_row['user_name'], ENT_QUOTES, 'UTF-8');
//if password was changed successfully
if ($success == true) {
_die("<center><small>Congratulations, your password has been reset.<br/>You can now <a href=\"/202-login.php\">login</a> with your new password.</small></center>");
}
if ($error['user_pass_key']) {
_die("<center><small>" . $error['user_pass_key'] . "<br/>Please use the <a href=\"/202-lost-pass.php\">password retrieval tool</a> to get a new password reset key.</small></center>");
}
//else if none of the above, show the code to reset!
?>
<?php
示例7: upgrade_databases
function upgrade_databases()
{
ini_set('max_execution_time', 60 * 10);
ini_set('max_input_time', 60 * 10);
//get the old version
$mysql_version = PROSPER202::mysql_version();
$php_version = PROSPER202::php_version();
//if the mysql is 1.0.2, upgrade to 1.0.3
if ($mysql_version == '1.0.2') {
//create the new mysql version table
$sql = "CREATE TABLE IF NOT EXISTS `202_version` (\r\n\t\t\t\t\t `version` varchar(50) NOT NULL\r\n\t\t\t\t\t) ENGINE=InnoDB ;";
$result = _mysqli_query($sql);
//drop the old table
$sql = "DROP TABLE `202_sort_landings`";
$result = _mysqli_query($sql);
//create the new landing page sorting table
$sql = "CREATE TABLE IF NOT EXISTS `202_sort_landing_pages` (\r\n\t\t\t\t `sort_landing_id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t `user_id` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t `landing_page_id` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t `sort_landing_page_clicks` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t `sort_landing_page_click_throughs` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t `sort_landing_page_ctr` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_leads` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t `sort_landing_page_su_ratio` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_payout` decimal(6,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_epc` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_avg_cpc` decimal(5,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_income` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_cost` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_net` decimal(10,2) NOT NULL,\r\n\t\t\t\t `sort_landing_page_roi` decimal(10,2) NOT NULL,\r\n\t\t\t\t PRIMARY KEY (`sort_landing_id`),\r\n\t\t\t\t KEY `user_id` (`user_id`),\r\n\t\t\t\t KEY `landing_page_id` (`landing_page_id`),\r\n\t\t\t\t KEY `sort_landing_page_clicks` (`sort_landing_page_clicks`),\r\n\t\t\t\t KEY `sort_landing_page_click_throughs` (`sort_landing_page_click_throughs`),\r\n\t\t\t\t KEY `sort_landing_page_ctr` (`sort_landing_page_ctr`),\r\n\t\t\t\t KEY `sort_landing_page_leads` (`sort_landing_page_leads`),\r\n\t\t\t\t KEY `sort_landing_page_su_ratio` (`sort_landing_page_su_ratio`),\r\n\t\t\t\t KEY `sort_landing_page_payout` (`sort_landing_page_payout`),\r\n\t\t\t\t KEY `sort_landing_page_epc` (`sort_landing_page_epc`),\r\n\t\t\t\t KEY `sort_landing_page_avg_cpc` (`sort_landing_page_avg_cpc`),\r\n\t\t\t\t KEY `sort_landing_page_income` (`sort_landing_page_income`),\r\n\t\t\t\t KEY `sort_landing_page_cost` (`sort_landing_page_cost`),\r\n\t\t\t\t KEY `sort_landing_page_net` (`sort_landing_page_net`),\r\n\t\t\t\t KEY `sort_landing_page_roi` (`sort_landing_page_roi`)\r\n\t\t\t\t) ENGINE=InnoDB ;";
$result = _mysqli_query($sql);
//this is now up to 1.0.3
$sql = "INSERT INTO 202_version SET version='1.0.3'";
$result = _mysqli_query($sql);
//now set the new mysql version
$mysql_version = '1.0.3';
}
//upgrade from 1.0.3 to 1.0.4
if ($mysql_version == '1.0.3') {
$sql = "UPDATE 202_version SET version='1.0.4'";
$result = _mysqli_query($sql);
$mysql_version = '1.0.4';
}
//upgrade from 1.0.4 to 1.0.5
if ($mysql_version == '1.0.4') {
$sql = "UPDATE 202_version SET version='1.0.5'";
$result = _mysqli_query($sql);
$mysql_version = '1.0.5';
}
//upgrade from 1.0.5 to 1.0.6
if ($mysql_version == '1.0.5') {
$sql = "UPDATE 202_version SET version='1.0.6'";
$result = _mysqli_query($sql);
$mysql_version = '1.0.6';
}
//upgrade from 1.0.6 to 1.1.0 - here we had some database modifications to make it scale better.
if ($mysql_version == '1.0.6') {
//this is upgrading things to BIGINT
$result = _mysqli_query("ALTER TABLE `202_clicks` \t\t\tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL");
$result = _mysqli_query("ALTER TABLE `202_clicks_advance` \tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL , \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `keyword_id` `keyword_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `ip_id` `ip_id` BIGINT UNSIGNED NOT NULL");
$result = _mysqli_query(" ALTER TABLE `202_clicks_counter` \tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ");
$result = _mysqli_query(" ALTER TABLE `202_clicks_record` \tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_clicks_site` \t\tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `click_referer_site_url_id` `click_referer_site_url_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `click_landing_site_url_id` `click_landing_site_url_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `click_outbound_site_url_id` `click_outbound_site_url_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `click_cloaking_site_url_id` `click_cloaking_site_url_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `click_redirect_site_url_id` `click_redirect_site_url_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_clicks_spy` \t\tCHANGE `click_id` `click_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_ips` \t\t\tCHANGE `ip_id` `ip_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ");
$result = _mysqli_query(" ALTER TABLE `202_keywords` \t\tCHANGE `keyword_id` `keyword_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ");
$result = _mysqli_query(" ALTER TABLE `202_last_ips` \t\tCHANGE `ip_id` `ip_id` BIGINT NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_mysql_errors` \tCHANGE `ip_id` `ip_id` BIGINT UNSIGNED NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `site_id` `site_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_site_domains` \tCHANGE `site_domain_id` `site_domain_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ");
$result = _mysqli_query(" ALTER TABLE `202_site_urls` \t\tCHANGE `site_url_id` `site_url_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCHANGE `site_domain_id` `site_domain_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_sort_ips` CHANGE `ip_id` `ip_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_sort_keywords` CHANGE `keyword_id` `keyword_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_sort_referers` CHANGE `referer_id` `referer_id` BIGINT UNSIGNED NOT NULL ");
$result = _mysqli_query(" ALTER TABLE `202_users` CHANGE `user_last_login_ip_id` `user_last_login_ip_id` BIGINT UNSIGNED NOT NULL ");
//mysql version set to 1.1.0 now
$sql = "UPDATE 202_version SET version='1.1.0'";
$result = _mysqli_query($sql);
$mysql_version = '1.1.0';
}
//upgrade from 1.1.0 to 1.1.1
if ($mysql_version == '1.1.0') {
$sql = "UPDATE 202_version SET version='1.1.1'";
$result = _mysqli_query($sql);
$mysql_version = '1.1.1';
}
//upgrade from 1.1.1 to 1.1.2
if ($mysql_version == '1.1.1') {
$sql = "UPDATE 202_version SET version='1.1.2'";
$result = _mysqli_query($sql);
$mysql_version = '1.1.2';
}
//upgrade from 1.1.2 to 1.2.0
if ($mysql_version == '1.1.2') {
$result = _mysqli_query("\t CREATE TABLE IF NOT EXISTS `202_rotations` (\r\n\t\t\t\t\t\t\t\t\t\t `aff_campaign_id` mediumint(8) unsigned NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t `rotation_num` tinyint(4) NOT NULL,\r\n\t\t\t\t\t\t\t\t\t\t PRIMARY KEY (`aff_campaign_id`)\r\n\t\t\t\t\t\t\t\t\t\t) ENGINE=MEMORY ; ");
$result = _mysqli_query("\tINSERT INTO 202_browsers SET browser_id = '9', browser_name = 'Chrome'");
$result = _mysqli_query("\tINSERT INTO 202_browsers SET browser_id = '10', browser_name = 'Mobile'");
$result = _mysqli_query("\tINSERT INTO 202_browsers SET browser_id = '11', browser_name = 'Console'");
$result = _mysqli_query(" \tALTER TABLE `202_clicks` CHANGE `click_cpc` `click_cpc` DECIMAL( 7, 5 ) NOT NULL ");
$result = _mysqli_query(" \tALTER TABLE `202_trackers` CHANGE `click_cpc` `click_cpc` DECIMAL( 7, 5 ) NOT NULL ");
$result = _mysqli_query(" \tALTER TABLE `202_users_pref` ADD `user_cpc_or_cpv` CHAR( 3 ) NOT NULL DEFAULT 'cpc' AFTER `user_pref_chart` ; ");
$result = _mysqli_query(" \tALTER TABLE `202_users_pref` ADD `user_keyword_searched_or_bidded` VARCHAR( 255 ) NOT NULL DEFAULT 'searched' AFTER `user_cpc_or_cpv` ; ");
$result = _mysqli_query(" \tALTER TABLE `202_aff_campaigns` ADD `aff_campaign_url_2` TEXT NOT NULL AFTER `aff_campaign_url` ,\r\n\t\t\t\t\t\t\t\t\t\tADD `aff_campaign_url_3` TEXT NOT NULL AFTER `aff_campaign_url_2` ,\r\n\t\t\t\t\t\t\t\t\t\tADD `aff_campaign_url_4` TEXT NOT NULL AFTER `aff_campaign_url_3` ,\r\n\t\t\t\t\t\t\t\t\t\tADD `aff_campaign_url_5` TEXT NOT NULL AFTER `aff_campaign_url_4` ;");
$result = _mysqli_query(" \tALTER TABLE `202_aff_campaigns` CHANGE `aff_campaign_url` `aff_campaign_url` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL");
$result = _mysqli_query(" \tALTER TABLE `202_aff_campaigns` ADD `aff_campaign_rotate` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `aff_campaign_time` ;");
$result = _mysqli_query(" \tALTER TABLE`202_sort_breakdowns` CHANGE `sort_breakdown_avg_cpc` `sort_breakdown_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_breakdown_cost` `sort_breakdown_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_breakdown_net` `sort_breakdown_net` DECIMAL( 13, 5 ) NOT NULL;");
$result = _mysqli_query(" \tALTER TABLE`202_sort_ips` CHANGE `sort_ip_avg_cpc` `sort_ip_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_ip_cost` `sort_ip_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_ip_net` `sort_ip_net` DECIMAL( 13, 5 ) NOT NULL;");
$result = _mysqli_query(" \tALTER TABLE`202_sort_keywords` CHANGE `sort_keyword_avg_cpc` `sort_keyword_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_keyword_cost` `sort_keyword_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_keyword_net` `sort_keyword_net` DECIMAL( 13, 5 ) NOT NULL;");
$result = _mysqli_query(" ALTER TABLE`202_sort_landing_pages` CHANGE `sort_landing_page_avg_cpc` `sort_landing_page_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_landing_page_cost` `sort_landing_page_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_landing_page_net` `sort_landing_page_net` DECIMAL( 13, 5 ) NOT NULL;");
$result = _mysqli_query(" \tALTER TABLE`202_sort_referers` CHANGE `sort_referer_avg_cpc` `sort_referer_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_referer_cost` `sort_referer_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_referer_net` `sort_referer_net` DECIMAL( 13, 5 ) NOT NULL;");
$result = _mysqli_query(" \tALTER TABLE`202_sort_text_ads` CHANGE `sort_text_ad_avg_cpc` `sort_text_ad_avg_cpc` DECIMAL( 7, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_text_ad_cost` `sort_text_ad_cost` DECIMAL( 13, 5 ) NOT NULL ,\r\n\t\t\t\t\t\t\t\t\t\tCHANGE `sort_text_ad_net` `sort_text_ad_net` DECIMAL( 13, 5 ) NOT NULL; ");
$sql = "UPDATE 202_version SET version='1.2.0'";
$result = _mysqli_query($sql);
$mysql_version = '1.2.0';
//.........这里部分代码省略.........
示例8: fetch_rss
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php';
AUTH::require_user();
#grab alert items
$rss = fetch_rss(TRACKING202_RSS_URL . '/prosper202/alerts');
if (isset($rss->items) && 0 != count($rss->items)) {
$rss->items = array_slice($rss->items, 0, 3);
}
foreach ($rss->items as $item) {
//check if this alert is already marked as seen
$mysql['prosper_alert_id'] = $db->real_escape_string($item['prosper_alert_id']);
$sql = "SELECT COUNT(*) AS count FROM 202_alerts WHERE prosper_alert_id='{$mysql['prosper_alert_id']}' AND prosper_alert_seen='1'";
$result = _mysqli_query($sql);
$row = $result->fetch_assoc();
if ($row['count']) {
#echo 'dont show';
$dontShow[$item['prosper_alert_id']] = true;
} else {
#echo 'show alerts';
$showAlerts = true;
}
}
#echo $showAlerts;
if (!$showAlerts) {
die;
}
#if items display the table
if ($rss->items) {
foreach ($rss->items as $item) {
if ($dontShow[$item['prosper_alert_id']] == false) {
示例9: getCampaignID
function getCampaignID($db, $campaign, $user)
{
$mysql['user_id'] = $db->real_escape_string($user);
$mysql['campaign_id'] = $db->real_escape_string($campaign);
$key_sql = "SELECT \t*\n\t\t\t\tFROM \t`202_aff_campaigns` \n\t\t\t\tWHERE \t`user_id`='" . $mysql['user_id'] . "' AND `aff_campaign_id`='" . $mysql['campaign_id'] . "'";
$key_result = _mysqli_query($db, $key_sql);
$key_row = $key_result->fetch_assoc();
if ($key_result->num_rows > 0) {
return true;
} else {
$json = json_encode(array('msg' => 'Campaign not found', 'error' => true, 'status' => 404), true);
print_r(pretty_json($json));
die;
}
}
示例10: substr
$user_row = $user_result->fetch_assoc();
if (!$user_row) {
$error['user'] = 'Invalid username /email combination.';
}
//i there isn't any error, give this user, a new password, and email it to them!
if (!$error) {
$mysql['user_id'] = $db->real_escape_string($user_row['user_id']);
//generate random key
$user_pass_key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$user_pass_key = substr(str_shuffle($user_pass_key), 0, 40) . time();
$mysql['user_pass_key'] = $db->real_escape_string($user_pass_key);
//set the user pass time
$mysql['user_pass_time'] = time();
//insert this verification key into the database, and the timestamp of inserting it
$update_sql = "\tUPDATE \t202_users \n\t\t\t\t\t\t\tSET \t\tuser_pass_key='" . $mysql['user_pass_key'] . "',\n\t\t\t\t\t\t\t\t\t\tuser_pass_time='" . $mysql['user_pass_time'] . "'\n\t\t\t\t\t\t\tWHERE\t\tuser_id='" . $mysql['user_id'] . "'";
$update_result = _mysqli_query($update_sql);
//now email the user the script to reset their email
$to = $_POST['user_email'];
$subject = "[Propser202 on " . $_SERVER['SERVER_NAME'] . "] Password Reset";
$message = "\n<p>Someone has asked to reset the password for the following site and username.</p>\n\n<p><a href=\"http://" . $_SERVER['SERVER_NAME'] . "\">http://" . $_SERVER['SERVER_NAME'] . "</a></p>\n\n<p>Username: " . $_POST['user_name'] . "</p>\n\n<p>To reset your password visit the following address, otherwise just ignore this email and nothing will happen.</p>\n\n<p><a href=\"http://" . $_SERVER['SERVER_NAME'] . "/202-pass-reset.php?key={$user_pass_key}\">http://" . $_SERVER['SERVER_NAME'] . "/202-pass-reset.php?key={$user_pass_key}</a></p>";
$from = "propser202@" . $_SERVER['SERVER_NAME'];
$header = "From: Propser202<" . $from . "> \r\n";
$header .= "Reply-To: " . $from . " \r\n";
$header .= "To: " . $to . " \r\n";
$header .= "Content-Type: text/html; charset=\"iso-8859-1\" \r\n";
$header .= "Content-Transfer-Encoding: 8bit \r\n";
$header .= "MIME-Version: 1.0 \r\n";
mail($to, $subject, $message, $header);
$success = true;
}
$html['user_name'] = htmlentities($_POST['user_name'], ENT_QUOTES, 'UTF-8');
示例11: RunSecondsCronjob
function RunSecondsCronjob()
{
$database = DB::getInstance();
$db = $database->getConnection();
//check to run the 1minute cronjob, change this to every minute
$now = time();
$everySeconds = 20;
//check to run the 1minute cronjob, change this to every minute
$now = time();
$today_second = date('s', time());
$today_minute = date('i', time());
$today_hour = date('G', time());
$today_day = date('j', time());
$today_month = date('n', time());
$today_year = date('Y', time());
$today_second = ceil($today_second / $everySeconds);
if ($today_second == 0) {
$today_second++;
}
//the click_time is recorded in the middle of the day
$cronjob_time = mktime($today_hour, $today_minute, $today_second, $today_month, $today_day, $today_year);
$mysql['cronjob_time'] = $db->real_escape_string($cronjob_time);
$mysql['cronjob_type'] = $db->real_escape_string('secon');
//check to make sure this click_summary doesn't already exist
$check_sql = "SELECT * FROM 202_cronjobs WHERE cronjob_type='" . $mysql['cronjob_type'] . "' AND cronjob_time='" . $mysql['cronjob_time'] . "'";
$check_result = $db->query($check_sql) or record_mysql_error($check_sql);
$check_count = $check_result->num_rows;
if ($check_count == 0) {
//if a cronjob hasn't run today, record it now.
$insert_sql = "INSERT INTO 202_cronjobs SET cronjob_type='" . $mysql['cronjob_type'] . "', cronjob_time='" . $mysql['cronjob_time'] . "'";
$insert_result = $db->query($insert_sql);
/* -------- THIS RUNS THE DELAYED QUERIES --------- */
$delayed_sql = "\n\t\t\tSELECT delayed_sql\n\t\t\tFROM 202_delayed_sqls\n\t\t\tWHERE delayed_time <=" . time() . "\n\t\t";
$delayed_result = _mysqli_query($delayed_sql);
while ($delayed_row = $delayed_result->fetch_assoc()) {
//run each sql
$update_sql = $delayed_row['delayed_sql'];
$update_result = _mysqli_query($update_sql);
}
//delete all old delayed sqls
$delayed_sql = "DELETE FROM 202_delayed_sqls WHERE delayed_time <=" . time();
$delayed_result = _mysqli_query($delayed_sql);
return true;
} else {
return false;
}
}
示例12: while
?>
<li>You have not added any networks.</li>
<?php
}
while ($ppc_network_row = $ppc_network_result->fetch_array(MYSQL_ASSOC)) {
//print out the PPC networks
$html['ppc_network_name'] = htmlentities($ppc_network_row['ppc_network_name'], ENT_QUOTES, 'UTF-8');
$url['ppc_network_id'] = urlencode($ppc_network_row['ppc_network_id']);
printf('<li>%s - <a href="?edit_ppc_network_id=%s">edit</a> - <a href="#" class="upgradeToProNeeded">variables</a> - <a href="?delete_ppc_network_id=%s" onclick="return confirmSubmit(\'Are You Sure You Want To Delete This Traffic Source?\');">remove</a></li>', $html['ppc_network_name'], $url['ppc_network_id'], $url['ppc_network_id']);
?>
<ul style="margin-top: 0px;">
<?php
//print out the individual accounts per each PPC network
$mysql['ppc_network_id'] = $db->real_escape_string($ppc_network_row['ppc_network_id']);
$ppc_account_sql = "SELECT * FROM `202_ppc_accounts` WHERE `ppc_network_id`='" . $mysql['ppc_network_id'] . "' AND `ppc_account_deleted`='0' ORDER BY `ppc_account_name` ASC";
$ppc_account_result = _mysqli_query($ppc_account_sql);
//($ppc_account_sql);
while ($ppc_account_row = $ppc_account_result->fetch_array(MYSQL_ASSOC)) {
$html['ppc_account_name'] = htmlentities($ppc_account_row['ppc_account_name'], ENT_QUOTES, 'UTF-8');
$url['ppc_account_id'] = urlencode($ppc_account_row['ppc_account_id']);
printf('<li>%s - <a href="?edit_ppc_account_id=%s">edit</a> - <a href="?delete_ppc_account_id=%s" onclick="return confirmSubmit(\'Are You Sure You Want To Delete This Account?\');">remove</a></li>', $html['ppc_account_name'], $url['ppc_account_id'], $url['ppc_account_id']);
}
?>
</ul>
<?php
}
?>
</ul>
</div>
</div>
</div>
示例13: _mysqli_query
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php';
AUTH::require_user();
$mysql['prosper_alert_id'] = $db->real_escape_string($_POST['prosper_alert_id']);
$alert_sql = "INSERT INTO 202_alerts SET prosper_alert_seen='1', prosper_alert_id='{$mysql['prosper_alert_id']}'";
$alert_sql = _mysqli_query($alert_sql);
示例14: _mysqli_query
</div>
</div>
<div class="row form_seperator">
<div class="col-xs-12"></div>
</div>
<div class="row account">
<div class="col-xs-12">
<h6>Last 50 Login Attempts</h6>
</div>
<div class="col-xs-12">
<?php
//show the last 20 logins failed or pass
$user_log_sql = "SELECT * FROM 202_users_log ORDER BY login_id DESC LIMIT 50";
$user_log_result = _mysqli_query($user_log_sql);
?>
<table class="table table-bordered">
<thead>
<tr>
<th>Time</th>
<th>Username</th>
<th>IP Address</th>
<th>Attempt</th>
</tr>
</thead>
<tbody>
<?php
while ($user_log_row = $user_log_result->fetch_assoc()) {
$html['user_name'] = htmlentities($user_log_row['user_name'], ENT_QUOTES, 'UTF-8');