当前位置: 首页>>代码示例>>PHP>>正文


PHP dbconnection::SelectColumn方法代码示例

本文整理汇总了PHP中dbconnection::SelectColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::SelectColumn方法的具体用法?PHP dbconnection::SelectColumn怎么用?PHP dbconnection::SelectColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dbconnection的用法示例。


在下文中一共展示了dbconnection::SelectColumn方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbconnection

<?php

require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_POST['username'])) {
    echo "please back and enter the user name";
    exit;
}
$_SESSION['username'] = $_POST['username'];
$arr = $dbobj->SelectColumn("email", "user", "uname", $_POST['username']);
if (count($arr) == 0) {
    echo "User Name is not exist";
    exit;
}
$email = $arr[0];
echo $email;
$seed = str_split('abcdefghijklmnopqrstuvwxyz' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . '0123456789');
$rand = '';
foreach (array_rand($seed, 5) as $k) {
    $rand .= $seed[$k];
}
$check = mail($email, "Confirmation Code is here", $rand, 'admin@cafeteria.com');
echo $check;
echo $rand;
if (!$check) {
    echo "lol";
    exit;
} else {
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:passwordRecovery.php

示例2: Validation

// $res = $dbobj->SelectColumn("content","comment","UID",1);
// foreach($res as $row)
// 	echo $row."<br>";
require_once "Validation.php";
// deconnection already included in Validation
$vobj = new Validation();
$dbobj = new dbconnection();
echo "sdasd";
// $susersid = $this->dbobj->SelectColumn('uid','user','admin','true');
$arr = array();
$arr['0'] = 1;
$arr['1'] = 2;
$arr['2'] = 3;
echo $arr[0];
print_r($arr);
$uid = 14;
$susersid = $dbobj->SelectColumn('uid', 'user', 'admin', 1);
print_r($susersid);
if ($flag = $vobj->ifSuperUserId(14)) {
    echo "true";
}
if ($flag = $vobj->ifSuperUserId(20)) {
    echo "true<br>";
}
echo "sdfsdf" . $flag . "<br>";
$flag = $vobj->ifSuperUser("doubleo");
echo "sdfsdf" . $flag . "<br>";
echo "<br>";
$susersid = $dbobj->SelectColumn('uid', 'user', 'admin', true);
print_r($susersid);
echo "<br>";
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:index.php

示例3: dbconnection

$_orders = "../layout/orders.php";
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
// if(!$vobj->ifSuperUserId($uid)){
//   echo "You are not authoriezed to enter this page. Only for admins.";
//   exit;
// }
$procOrds = $dbobj->SelectColumn('oid', 'orders', 'processing', 1);
$flag = true;
do {
    foreach ($procOrds as $outoid) {
        $outOrds = $dbobj->Select("SELECT `oid` FROM `orders` WHERE `processing`=0 AND `oid`='{$outoid}'");
        if (isset($outOrds[0])) {
            $flag = false;
            $oid = $outOrds[0];
            break;
        }
        // sleep(1);
    }
    clearstatcache();
    sleep(1);
} while ($flag);
// // do{
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:deliver_server.php

示例4: array

//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
// $_SESSION['uid'] = $uid;
$activeusersArr = $dbobj->Select('select * from user,room where user.rid=room.rid');
$users = array();
foreach ($activeusersArr as $row) {
    if (!$row['admin']) {
        array_push($users, $row['uname']);
    }
}
// $users = $dbobj->SelectColumn('uname','user',null,null);
$rooms = $dbobj->SelectColumn('rname', 'room', null, null);
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$imgname = $dbobj->SelectColumn('imgname', 'user', 'uid', $uid);
$imgname = $imgname[0];
$img = "../images/user/" . $imgname;
include "common/header.php";
?>
<html>
	
	<head>
		<meta charset="UTF-8">
		<title>Checks</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<script src="js/jquery-1.11.2.js"></script>
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:Checks.php

示例5: dbconnection

$dbobj = new dbconnection();
$vobj = new Validation();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$_product = "../layout/products.php";
$pname = $_POST['pname'];
$price = $_POST['price'];
$category = trim($_POST['category']);
$cid = $dbobj->SelectColumn('cid', 'category', 'cname', $category);
$cid = $cid[0];
$products = $dbobj->SelectColumn('pname', 'product', null, null);
foreach ($products as $product) {
    if ($pname == $product) {
        echo "product already exists";
        exit;
    }
}
// upload image
$target_dir = "../images/product/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
// print_r($_FILES["fileToUpload"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
$imgname = $pname . "." . $imageFileType;
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:add_product.php

示例6: array

}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$_users_img = "../images/user/";
$_products_img = "../images/product/";
$activeusersArr = $dbobj->Select('select * from user,room where user.rid=room.rid');
$usersArr = array();
foreach ($activeusersArr as $row) {
    if (!$row['admin']) {
        array_push($usersArr, $row);
    }
}
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$imgname = $dbobj->SelectColumn('imgname', 'user', 'uid', $uid);
$imgname = $imgname[0];
$_controller = "../controller";
$_layout = "../layout";
$_add_user = "../layout/add_user.php";
$img = $_users_img . $imgname;
$processingOrders = $dbobj->Select('select uname,rname,odate,ext,otime,user.uid,orders.oid,user.imgname from user,room,orders where user.uid=orders.uid AND user.rid=room.rid AND orders.processing=true;');
include "common/header.php";
?>
<html>
<head>
	<title></title>
	
</head>
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:orders.php

示例7: dbconnection

$_orders = "../layout/orders.php";
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$aliveOrds = $dbobj->SelectColumn('oid', 'orders', 'alive', 1);
$flag = true;
do {
    foreach ($aliveOrds as $aoid) {
        $deadOrds = $dbobj->Select("SELECT `oid` FROM `orders` WHERE `alive`=0 AND `oid`='{$aoid}'");
        if (isset($deadOrds[0])) {
            $flag = false;
            $oid = $deadOrds[0];
            break;
        }
        // sleep(1);
    }
    clearstatcache();
    sleep(1);
} while ($flag);
// // do{
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:cancel_server.php

示例8: dbconnection

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$_product = "../../layout/products.php";
session_start();
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$pid = $_GET['pid'];
$avb = $dbobj->SelectColumn('available', 'product', 'pid', $pid);
$avb = $avb[0];
$avb = !$avb;
$dbobj->Update("update product set `available`='{$avb}' where `pid`='{$pid}'");
header("location:" . $_product . "?uid=" . $uid);
开发者ID:korabieka,项目名称:PHP_Project,代码行数:25,代码来源:toggle_avb.php

示例9: dbconnection

require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$categories = $dbobj->SelectColumn('cname', 'category', null, null);
$uname = $dbobj->SelectColumn('uname', 'user', 'uid', $uid);
$uname = $uname[0];
$img = "img/users/" . $uname . ".jpeg";
include "common/header.php";
?>
<html>
<head>
	<title></title>
	
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 well">
				<h1 class="col-md-4">Add Category</h1>
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:addCategory.php

示例10: dbconnection

// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
session_start();
//$uid = $_GET['uid'];
if (!isset($_SESSION['uid'])) {
    echo "You are not authoriezed to enter this page. You have to login first";
    exit;
}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$pid = $_GET['pid'];
$categories = $dbobj->SelectColumn('cname', 'category', null, null);
$pro_rec = $dbobj->Select("select `pname`,`price`,`cid`,`imgname` from product where `pid`='{$pid}'");
$pro_rec = $pro_rec[0];
$pname = $pro_rec['pname'];
$price = $pro_rec['price'];
$cid = $pro_rec['cid'];
$imgname = $pro_rec['imgname'];
$cname = $dbobj->SelectColumn("cname", "category", "cid", $cid);
$cname = $cname[0];
$_edit_product = "../../controller/edit_product.php";
?>
<html>
<head>
	<title></title>
	
</head>
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:edit_product.php

示例11:

}
$uid = $_SESSION['uid'];
if (!$vobj->ifSuperUserId($uid)) {
    echo "You are not authoriezed to enter this page. Only for admins.";
    exit;
}
$edtuid = $_GET['uid'];
$edt_rec = $dbobj->Select("select `uname`,`email`,`rid`,`ext`,`fname`,`lname` from user where `uid`='{$edtuid}'");
$edt_rec = $edt_rec[0];
$uname = $edt_rec['uname'];
$email = $edt_rec['email'];
$rid = $edt_rec['rid'];
$ext = $edt_rec['ext'];
$fname = $edt_rec['fname'];
$lname = $edt_rec['lname'];
$rname = $dbobj->SelectColumn('rname', 'room', 'rid', $rid);
$rname = $rname[0];
$_edit_user = "../controller/edit_user.php";
?>
<html>
<head>
	<title></title>
	
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-12 well">
				<h1 class="col-md-4">Edit User</h1>
					<div class="col-md-6"></div>
			</div>
开发者ID:korabieka,项目名称:PHP_Project,代码行数:31,代码来源:edit_user.php


注:本文中的dbconnection::SelectColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。