本文整理汇总了PHP中re_db_query函数的典型用法代码示例。如果您正苦于以下问题:PHP re_db_query函数的具体用法?PHP re_db_query怎么用?PHP re_db_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了re_db_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateRandomString
function generateRandomString($length, $api_key)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
$client_sql = re_db_query("SELECT * FROM cs_sites WHERE api_key='" . $randomString . "' OR api_secret='" . $randomString . "'");
if (re_db_num_rows($client_sql) > 0) {
generateRandomString('10');
} else {
if ($api_key == $randomString) {
generateRandomString('10');
} else {
return $randomString;
}
}
}
示例2: re_db_query
exit;
}
}
if (!isset($_POST['save_btn']) && isset($_SESSION['admin_id'])) {
$social_key_qry = "select * from cs_client_social_key where client_id='" . $_SESSION['admin_id'] . "'";
$social_key_sql = re_db_query($social_key_qry);
if (re_db_num_rows($social_key_sql) > 0) {
$tot_rec = re_db_num_rows($social_key_sql);
while ($social_key_rec = re_db_fetch_array($social_key_sql)) {
$auto_id[$social_key_rec['social_id']] = $social_key_rec['id'];
$api_key[$social_key_rec['social_id']] = $social_key_rec['api_key'];
$secret_key[$social_key_rec['social_id']] = $social_key_rec['secret_key'];
}
}
}
$social_sql = re_db_query("select * from cs_social_network_master where is_display='1'");
if (isset($_SESSION['msg']) && $_SESSION['msg'] == "insert") {
$msg = "Change Saved Successfully.";
unset($_SESSION['msg']);
}
include "header.php";
?>
<div class="content-wrap">
<!-- main page content. the place to put widgets in. usually consists of .row > .col-md-* > .widget. -->
<main id="content" class="content" role="main">
<ol class="breadcrumb">
<li>YOU ARE HERE</li>
<li class="active">Authorization Settings</li>
</ol>
<!--h1 class="page-title">Site - <span class="fw-semi-bold">Settings</span></h1-->
<div class="row">
示例3: join
<?php
include "include/config.php";
$sel = "select id,likes,client_id from cs_users cs join (select member_id,likes from cs_fb_share_users where likes!='' ) as cu on cu.member_id=cs.id where cs.is_fb='1'";
$res_sel = re_db_query($sel);
while ($row_sel = re_db_fetch_array($res_sel)) {
$likes = explode(",", $row_sel['likes']);
foreach ($likes as $key => $val) {
if ($val != '') {
re_db_query("insert into cs_member_pages_like (member_id,page_id,client_id) values ('" . mysql_real_escape_string($row_sel['id']) . "',(select id from cs_like_pages where page_title='" . mysql_real_escape_string($val) . "'),'" . $row_sel['client_id'] . "')");
}
}
}
exit("Dilip it is all over");
示例4: mysql_fetch_array
$csuser_id = 0;
if (mysql_num_rows($res_user) > 0) {
$row_user = mysql_fetch_array($res_user);
$csuser_id = $row_user['id'];
$update_query = "update cs_li_data";
$where = " where member_id='" . mysql_real_escape_string($member_id) . "'";
} else {
$update_query = "insert into cs_li_data";
$where = "";
}
if (intval($udata->byear) == '0') {
$byear = "0000";
} else {
$byear = intval($udata->byear);
}
$set_query = $update_query . " set \n member_id='" . mysql_real_escape_string($member_id) . "',\n profile_id='" . mysql_real_escape_string($udata->id) . "', \n firstname='" . mysql_real_escape_string($udata->firstName) . "',\n lastname='" . mysql_real_escape_string($udata->lastName) . "',\n bday='" . mysql_real_escape_string(intval($udata->bday)) . "',\n bmonth='" . mysql_real_escape_string(intval($udata->bmonth)) . "',\n byear='" . mysql_real_escape_string($byear) . "',\n headline='" . mysql_real_escape_string($udata->headline) . "',\n industry='" . mysql_real_escape_string($udata->industry) . "',\n location='" . mysql_real_escape_string($udata->location) . "',\n numConnections='" . mysql_real_escape_string($udata->numConnections) . "',\n pictureUrl='" . mysql_real_escape_string($udata->pictureUrl) . "',\n publicProfileUrl='" . mysql_real_escape_string($udata->publicProfileUrl) . "' \n " . $where . "\n ";
re_db_query($set_query);
if (!isset($_GET['clickurl']) && $_GET['to_share'] == '1') {
echo $member_id;
exit;
}
if (!isset($_GET['clickurl']) && $_GET['to_share'] == '0') {
echo "no_share~" . $udata->emailAddress;
exit;
}
}
/*LINKED DATA END*/
}
?>
示例5: manage_fb_page
function manage_fb_page($fb_page_title, $fb_page_id, $member_id, $client_id, $total_likes)
{
$select_all = "select * from `cs_like_pages` where page_title='" . mysql_real_escape_string($fb_page_title) . "'";
$res_like = re_db_query($select_all);
if (re_db_num_rows($res_like) > 0) {
$row_page = re_db_fetch_array($res_like);
re_db_query("update cs_like_pages set fb_page_id='" . $fb_page_id . "',total_likes='" . $total_likes . "' where id='" . $row_page['id'] . "'");
$user_entry = re_db_query("select id from `cs_member_pages_like` where page_id='" . $row_page['id'] . "' and client_id='" . $client_id . "' and member_id='" . $member_id . "'");
if (re_db_num_rows($user_entry) <= 0) {
$insert_user = "insert into `cs_member_pages_like` set page_id='" . $row_page['id'] . "',member_id='" . $member_id . "',client_id='" . $client_id . "'";
re_db_query($insert_user);
}
} else {
$insert_cs = re_db_query("insert into cs_like_pages set page_title='" . mysql_real_escape_string($fb_page_title) . "',fb_page_id='" . $fb_page_id . "',total_likes='" . $total_likes . "'");
$last_page_id = mysql_insert_id();
$insert_user = "insert into `cs_member_pages_like` set page_id='" . $last_page_id . "',member_id='" . $member_id . "',client_id='" . $client_id . "'";
re_db_query($insert_user);
}
}
示例6: COUNT
$fb_sub_age_qry = "SELECT COUNT(*) as total, CASE WHEN age = 0 THEN 'NP' WHEN age > 0 AND age < 13 THEN '13' WHEN age >=13 AND age <=17 THEN '13-17' WHEN age >=18 AND age <=34 THEN '18-34' WHEN age >=35 AND age <= 49 THEN '35-49' WHEN age >=50 THEN '50+' END AS ageband FROM ( " . $select_fb_main . " ) as tbl GROUP BY ageband";
$fb_sub_age_sql = re_db_query($fb_sub_age_qry);
if (re_db_num_rows($fb_sub_age_sql) > 0) {
while ($fb_sub_age_rec = re_db_fetch_array($fb_sub_age_sql)) {
$fb_age_arr[$fb_sub_age_rec['ageband']] = $fb_sub_age_rec['total'];
}
}
$gp_sub_age_qry = "SELECT COUNT(*) as total, CASE WHEN age = 0 THEN 'NP' WHEN age > 0 AND age < 13 THEN '13' WHEN age >=13 AND age <=17 THEN '13-17' WHEN age >=18 AND age <=34 THEN '18-34' WHEN age >=35 AND age <= 49 THEN '35-49' WHEN age >=50 THEN '50+' END AS ageband FROM ( " . $select_gp_main . " ) as tbl GROUP BY ageband";
$gp_sub_age_sql = re_db_query($gp_sub_age_qry);
if (re_db_num_rows($gp_sub_age_sql) > 0) {
while ($gp_sub_age_rec = re_db_fetch_array($gp_sub_age_sql)) {
$gp_age_arr[$gp_sub_age_rec['ageband']] = $gp_sub_age_rec['total'];
}
}
$li_sub_age_qry = "SELECT COUNT(*) as total, CASE WHEN age = 0 THEN 'NP' WHEN age > 0 AND age < 13 THEN '13' WHEN age >=13 AND age <=17 THEN '13-17' WHEN age >=18 AND age <=34 THEN '18-34' WHEN age >=35 AND age <= 49 THEN '35-49' WHEN age >=50 THEN '50+' END AS ageband FROM ( " . $select_li_main . " ) as tbl GROUP BY ageband";
$li_sub_age_sql = re_db_query($li_sub_age_qry);
if (re_db_num_rows($li_sub_age_sql) > 0) {
while ($li_sub_age_rec = re_db_fetch_array($li_sub_age_sql)) {
$li_age_arr[$li_sub_age_rec['ageband']] = $li_sub_age_rec['total'];
}
}
?>
<script type="text/javascript">
var chartAge;
var typesAge = [
<?php
$i = 0;
$total = count($main_age_arr);
foreach ($main_age_arr as $key => $val) {
$i++;
if ($key == "NP") {
示例7: fwrite
fwrite($myfile, $txt) or die("Unable to file write!");
fclose($myfile);
$_SESSION['msg'] = "update";
}
//$_SESSION['msg']="update";
header("location:follow_bar_setting.php");
exit;
}
}
if (!isset($_POST['save'])) {
$site_data_qry = "select * from cs_sites where id='" . $_SESSION['admin_id'] . "'";
$site_data_sql = re_db_query($site_data_qry);
if (re_db_num_rows($site_data_sql) > 0) {
$site_data_rec = re_db_fetch_array($site_data_sql);
$follow_btn_size = $site_data_rec['follow_btn_size'];
$detail_sql = re_db_query("select * from cs_follow_bar_setting where client_id='" . $_SESSION['admin_id'] . "'");
if (re_db_num_rows($detail_sql) > 0) {
$i = 0;
while ($detail_rec = re_db_fetch_array($detail_sql)) {
$i++;
$provider[$i] = $detail_rec['provider'];
$provider_url[$i] = $detail_rec['provider_url'];
$provider_title[$i] = $detail_rec['provider_title'];
$provider_id[$i] = $detail_rec['provider_id'];
}
}
}
}
if ($provider[1] == "") {
$file_url = "";
}
示例8: sum
<div class="widget-body">
<?php
$dateRange = "";
$ageRange = "";
$select_rev_main = "select sum(if(ot.is_from=1,ot.order_amt,0)) as fb_total, sum(if(ot.is_from=2,ot.order_amt,0)) as li_total, sum(if(ot.is_from=3,ot.order_amt,0)) as gp_total, sum(if(ot.is_from=5,ot.order_amt,0)) as yh_total, sum(if(ot.is_from=6,ot.order_amt,0)) as ig_total, date_format(ot.date_time,'%m-%d-%Y') as order_date from cs_track_orders as ot, `cs_users` as csu where csu.id=ot.ref_by and ot.client_id=csu.client_id and ot.date_time is not null and ot.client_id='" . $_SESSION['admin_id'] . "' ";
if (isset($_POST['day_range']) && ($_POST['day_range'] == '0' || $_POST['day_range'] == '1')) {
$select_rev_main .= " and datediff(current_date,ot.date_time) ='" . $_POST['day_range'] . "'";
} else {
if (isset($_POST['day_range']) && $_POST['day_range'] > 1) {
$select_rev_main .= " and datediff(current_date,ot.date_time) <='" . $_POST['day_range'] . "'";
} else {
$select_rev_main .= " and datediff(current_date,ot.date_time) <='30'";
}
}
$select_rev_main .= " group by date_format(ot.date_time,'%m-%d-%Y')";
$rev_main_sql = re_db_query($select_rev_main);
$total = re_db_num_rows($rev_main_sql);
?>
<script type="text/javascript">
var chart = AmCharts.makeChart("rbpBarChartDiv", {
"type": "serial",
"theme": "none",
"startDuration": 2,
"depth3D":20,
"angle":30,
"legend": {
"menuTop": '0px',
"horizontalGap": 1,
"maxColumns": 1,
"position": "right",
"useGraphSettings": true,
示例9: md5
}
if (isset($_POST['pass']) && $_POST['pass'] == "") {
$error[] = "Please enter password.";
}
if (count($error) <= 0) {
$sel_cs = "INSERT INTO `cs_sites` SET \r\n firstname='" . $_POST['firstname'] . "',\r\n lastname='" . $_POST['lastname'] . "',\r\n site_url='" . $_POST['site_url'] . "', \r\n site_admin='" . $_POST['site_admin'] . "',\r\n fb_app_id='" . $_POST['fb_app_id'] . "',\r\n twitter_app_id='" . $_POST['twitter_app_id'] . "',\r\n linkedin_app_id='" . $_POST['linkedin_app_id'] . "',\r\n gplus_app_id='" . $_POST['gplus_app_id'] . "',\r\n yahoo_app_id='" . $_POST['yahoo_app_id'] . "',\r\n admin_email='" . $_POST['email'] . "',\r\n admin_password='" . md5($_POST['pass']) . "'";
re_db_query($sel_cs);
$last_id = re_db_insert_id();
if ($_FILES['admin_img']['name'] != "") {
$filename = basename($_FILES['admin_img']['name']);
$ext = strtolower(getEXT($filename));
$orgfilename = "cs_admin_" . $last_id . "." . $ext;
$uploaddir = DIR_FS . "img/cs_admin/" . $orgfilename;
move_uploaded_file($_FILES['admin_img']['tmp_name'], $uploaddir);
$u_update = "update cs_sites set admin_img='" . $orgfilename . "' where id='" . $last_id . "'";
re_db_query($u_update);
}
header("location:login.php?msg=reg");
exit;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Sing Up</title>
<link href="css/application.min.css" rel="stylesheet">
<!-- as of IE9 cannot parse css files with more that 4K classes separating in two files -->
<!--[if IE 9]>
<link href="css/application-ie9-part2.css" rel="stylesheet">
<![endif]-->
示例10: header
if (isset($_POST['user']) && ($_POST['user'] == "" || $_POST['pass'] == "")) {
$error[] = "Please enter username and password.";
}
if (count($error) <= 0) {
if ($_POST['user'] == "csadmin" && md5($_POST['pass']) == "29ad0e3fd3db681fb9f8091c756313f7") {
$_SESSION['admin_type'] = "master";
$_SESSION['admin_id'] = "1";
$_SESSION['firstname'] = "Master";
$_SESSION['lastname'] = "Admin";
$_SESSION['admin_email'] = "admin@coupay.co.in";
$_SESSION['admin_img'] = "admin_1.jpg";
header("location:index.php");
exit;
} else {
$sel_cs = "select * from `cs_sites` where admin_email='" . $_POST['user'] . "' and admin_password='" . md5($_POST['pass']) . "' and is_approved='1'";
$rec_cs = re_db_query($sel_cs);
if (re_db_num_rows($rec_cs) > 0) {
$row_cs = re_db_fetch_array($rec_cs);
$_SESSION['admin_type'] = "client";
$_SESSION['admin_id'] = $row_cs['id'];
$_SESSION['site_admin'] = $row_cs['site_admin'];
$_SESSION['firstname'] = $row_cs['firstname'];
$_SESSION['lastname'] = $row_cs['lastname'];
$_SESSION['admin_email'] = $row_cs['admin_email'];
$_SESSION['admin_img'] = $row_cs['admin_img'];
$_SESSION['fb_app_id'] = $row_cs['fb_app_id'];
$_SESSION['twitter_app_id'] = $row_cs['twitter_app_id'];
$_SESSION['linkedin_app_id'] = $row_cs['linkedin_app_id'];
header("location:index.php");
exit;
} else {
示例11: count
} else {
if (trim($_POST['password']) != trim($_POST['password-r'])) {
$err[] = "Please enter the same password";
} else {
$select_login_query = "select count(*) as admin_cnt from cs_sites where admin_password='" . md5($_POST['old_password']) . "' and id='" . $_SESSION['admin_id'] . "'";
$select_login = re_db_query($select_login_query);
$fetch_login = re_db_fetch_array($select_login);
if ($fetch_login['admin_cnt'] == '0') {
$err[] = "Your old password doesn't match.";
}
}
}
}
if (count($err) == 0) {
$update_login_query = "UPDATE `cs_sites` SET `admin_password` = '" . md5($_POST['password']) . "' WHERE id='" . $_SESSION['admin_id'] . "'";
re_db_query($update_login_query);
$_SESSION['msg'] = "2";
header("Location:change_password.php");
exit;
}
}
if (isset($_SESSION['msg']) && $_SESSION['msg'] == "2") {
$msg = "Password changed successfully.";
unset($_SESSION['msg']);
}
include "header.php";
?>
<div class="chat-sidebar" id="chat">
<div class="chat-sidebar-content">
<header class="chat-sidebar-header">
<h4 class="chat-sidebar-title">Contacts</h4>
示例12: header
<?php
include "include/config.php";
if (!isset($_SESSION['admin_id'])) {
header("location:login.php");
exit;
}
$fb_data_qry = "select * from cs_fb_share_users where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$fb_data_sql = re_db_query($fb_data_qry);
$li_data_qry = "select lid.*, csu.email from cs_li_data as lid, cs_users as csu where csu.id=lid.member_id and csu.client_id='" . $_SESSION['admin_id'] . "' and member_id='" . mysql_real_escape_string($_GET['mid']) . "' ";
$li_data_sql = re_db_query($li_data_qry);
$gp_data_qry = "select * from cs_gp_users where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$gp_data_sql = re_db_query($gp_data_qry);
include "header.php";
?>
<div class="content-wrap">
<!-- main page content. the place to put widgets in. usually consists of .row > .col-md-* > .widget. -->
<main id="content" class="content" role="main">
<ol class="breadcrumb">
<li>YOU ARE HERE</li>
<li class="active">User Profile</li>
</ol>
<h1 class="page-title">User - <span class="fw-semi-bold">Profile</span></h1>
<div class="row">
<div class="col-md-12">
<section class="widget">
<header>
<h4>User's FB <small>Profile</small></h4>
<div class="widget-controls">
<a data-widgster="expand" title="Expand" href="#"><i class="glyphicon glyphicon-chevron-up"></i></a>
<a data-widgster="collapse" title="Collapse" href="#"><i class="glyphicon glyphicon-chevron-down"></i></a>
示例13: re_db_query
<?php
if (isset($_SESSION['admin_type']) && $_SESSION['admin_type'] == "master") {
$chl_app_sql = re_db_query("select * from cs_sites where is_approved='0'");
$tot_app = re_db_num_rows($chl_app_sql);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Coupay Social - Dashboard</title>
<link href="css/application.min.css" rel="stylesheet">
<!-- as of IE9 cannot parse css files with more that 4K classes separating in two files -->
<!--[if IE 9]>
<link href="css/application-ie9-part2.css" rel="stylesheet">
<![endif]-->
<link rel="shortcut icon" href="img/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script>
/* yeah we need this empty stylesheet here. It's cool chrome & chromium fix
chrome fix https://code.google.com/p/chromium/issues/detail?id=167083
https://code.google.com/p/chromium/issues/detail?id=332189
*/
</script>
<script type="text/javascript" language="javascript">
var sitepath='http://www.coupay.com.sg/';
示例14: header
header("location:login.php");
exit;
}
$select_cu = "select email from cs_users where id='" . mysql_real_escape_string($_GET['mid']) . "'";
$res_cu = re_db_query($select_cu);
$row_cu = re_db_fetch_array($res_cu);
$fb_data_qry = "select * from cs_fb_share_users where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$fb_data_sql = re_db_query($fb_data_qry);
$li_data_qry = "select lid.*, csu.email from cs_li_data as lid, cs_users as csu where csu.id=lid.member_id and csu.client_id='" . $_SESSION['admin_id'] . "' and member_id='" . mysql_real_escape_string($_GET['mid']) . "' ";
$li_data_sql = re_db_query($li_data_qry);
$gp_data_qry = "select * from cs_gp_users where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$gp_data_sql = re_db_query($gp_data_qry);
$yh_data_qry = "select * from cs_yahoo_data where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$yh_data_sql = re_db_query($yh_data_qry);
$ig_data_qry = "select * from cs_ig_data where member_id='" . mysql_real_escape_string($_GET['mid']) . "' and client_id='" . $_SESSION['admin_id'] . "' ";
$ig_data_sql = re_db_query($ig_data_qry);
$is_profile = 0;
if (re_db_num_rows($fb_data_sql) > 0 || re_db_num_rows($gp_data_sql) > 0 || re_db_num_rows($li_data_sql) > 0 || re_db_num_rows($yh_data_sql) > 0 || re_db_num_rows($ig_data_sql) > 0) {
$is_profile = 1;
$fb_data_rec = re_db_fetch_array($fb_data_sql);
$li_data_rec = re_db_fetch_array($li_data_sql);
$gp_data_rec = re_db_fetch_array($gp_data_sql);
$yh_data_rec = re_db_fetch_array($yh_data_sql);
$ig_data_rec = re_db_fetch_array($ig_data_sql);
if ($fb_data_rec['profile_pic']) {
$profle_pic = $fb_data_rec['profile_pic'];
} else {
if ($li_data_rec['pictureUrl']) {
$profle_pic = $li_data_rec['pictureUrl'];
} else {
if ($gp_data_rec['profile_pic']) {
示例15: re_db_query
$error[] = "Please enter proper icon height.";
}
}
$disabled = "";
}
if (count($error) <= 0) {
$u_update = "update cs_sites set \n icon_size='" . $icon_size . "', \n req_custom='" . $req_custom . "', \n custom_icon_size='" . $custom_icon_size . "' \n where id='" . $_SESSION['admin_id'] . "'";
re_db_query($u_update);
$_SESSION['msg'] = "update";
header("location:social_icon_setting.php");
exit;
}
}
if (!isset($_POST['update'])) {
$site_data_qry = "select * from cs_sites where id='" . $_SESSION['admin_id'] . "'";
$site_data_sql = re_db_query($site_data_qry);
if (re_db_num_rows($site_data_sql) > 0) {
$site_data_rec = re_db_fetch_array($site_data_sql);
$icon_size = $site_data_rec['icon_size'];
$req_custom = $site_data_rec['req_custom'];
$custom_icon_size = $site_data_rec['custom_icon_size'];
$is_size_approved = $site_data_rec['is_size_approved'];
if ($req_custom == "1") {
$custom_icon_size_arr = explode('x', $custom_icon_size);
$icon_w = $custom_icon_size_arr[0];
$icon_h = $custom_icon_size_arr[1];
$disabled = "";
}
}
}
if (isset($_SESSION['msg']) && $_SESSION['msg'] == "update") {