本文整理汇总了PHP中dbconnection::Select方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::Select方法的具体用法?PHP dbconnection::Select怎么用?PHP dbconnection::Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbconnection
的用法示例。
在下文中一共展示了dbconnection::Select方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Validation
$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{
// // $updated_processing = $dbobj->SelectColumn('processing','orders','oid',$oid);
// $aliveOrds = $dbobj->SelectColumn('oid','orders','alive',1);
// // foreach ($aliveOrds as $aoid) {
// // $outOrd = $dbobj->Select("SELECT `oid` from `orders` WHERE `alive`=0 AND `oid`='$aiod");
示例2: dbconnection
<?php
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'];
// $_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>
示例3: dbconnection
<?php
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'];
// $_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";
?>
示例4: dbconnection
// 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;
}
$_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;');
示例5: Validation
$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{
// // $updated_processing = $dbobj->SelectColumn('processing','orders','oid',$oid);
// $aliveOrds = $dbobj->SelectColumn('oid','orders','alive',1);
// // foreach ($aliveOrds as $aoid) {
// // $outOrd = $dbobj->Select("SELECT `oid` from `orders` WHERE `alive`=0 AND `oid`='$aiod");
示例6: dbconnection
<?php
$_admin_order = "../layout/ManualOrders.php";
$_user_order = "../layout/UserOrders.php";
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
require_once "../include/Validation.php";
// deconnection already included in Validation
$dbobj = new dbconnection();
$vobj = new Validation();
$crruname = trim($_POST['username']);
$crrpwd = md5(trim($_POST['pwd']));
if (!$vobj->ifUserExists($crruname)) {
echo "User not found";
exit;
}
$urecord = $dbobj->Select("select `uid`,`password`,`admin` from `user` where `uname`='{$crruname}'");
$urecord = $urecord[0];
if ($crrpwd != $urecord['password']) {
echo "Passwords did not match";
exit;
}
$_SESSION['uid'] = $urecord['uid'];
if ($urecord['admin']) {
header("location:" . $_admin_order . "?uid=" . $urecord['uid']);
} else {
header("location:" . $_user_order . "?uid=" . $urecord['uid']);
}
// print_r($urecord);
//
示例7: elseif
<div class="form-group">
<div class="col-sm-offset-10 col-sm-2">
<input type="submit" class="btn btn-sm btn-default" value="Confirm">
</div>
</div>
<!--hakammel hena-->
</form>
</div>
<div class="col-lg-7">
<label>Latest Order</label>
<br>
<div class="col-lg-12">
<table class="table table-striped">
<?php
$imgCounter = 0;
$result = $dbobj->Select("select pname,imgname from product,orders,order_detail where product.pid=order_detail.pid and orders.oid=order_detail.oid and orders.uid='" . $_SESSION['uid'] . "' order by odate desc limit 1");
for ($i = 0; $i < count($result); $i++) {
if ($imgCounter == 0) {
echo "<tr>";
}
if ($imgCounter != 2) {
echo "<td><figure><img src='../images/product/" . $result[$i]['imgname'] . "' width='200px' height='200px'/><figcaption align='center'>" . $result[$i]['pname'] . "</figcaption></figure></td>";
$imgCounter++;
} elseif ($imgCounter == 2) {
echo "<td><figure><img src='../images/product/" . $result[$i]['imgname'] . "' width='200px' height='200px'/><figcaption align='center'>" . $result[$i]['pname'] . "</figcaption></figure></td></tr>";
$imgCounter = 0;
}
}
?>
</table>
</div>
示例8: dbconnection
$dbobj = new dbconnection();
//-----------------------p1_where for query----------------
$p1_where = " where orders.uid = user.uid and alive= 1 ";
if ($fdate != null) {
$p1_where .= " and `odate` >= '{$fdate}' ";
}
if ($fdate != null) {
$p1_where .= " and `odate` <= '{$tdate}' ";
}
if ($uid != null) {
$p1_where .= " and `uname` = '{$uid}' ";
}
$p1_where .= " group by user.uid; ";
//-----------------
$query = "select user.uid uid,uname,sum(totalamount)total from orders,user" . $p1_where;
$orders = $dbobj->Select($query);
//-----------------------p2_where for query----------------
$p2_where = " where orders.uid = user.uid ";
if ($fdate != null) {
$p2_where .= " and `odate` >= '{$fdate}' ";
}
if ($fdate != null) {
$p2_where .= " and `odate` <= '{$tdate}' ";
}
if ($uid != null) {
$p2_where .= " and `uname` = '{$uid}' ";
}
$p2_where .= "; ";
$details_query = " select user.uid,oid,odate,time_format(otime,'%h:%i %p') otime,totalamount from orders,user " . $p2_where;
$order_details = $dbobj->Select($details_query);
//-----------------------------------
示例9: dbconnection
$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>
<body>
示例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;
}
$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>