本文整理汇总了PHP中MysqliDb::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP MysqliDb::orderBy方法的具体用法?PHP MysqliDb::orderBy怎么用?PHP MysqliDb::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MysqliDb
的用法示例。
在下文中一共展示了MysqliDb::orderBy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMessageToAll
/**
* send message to all users
* @param $text
* @param $chatid
* @param $status
* @param MysqliDb $db
* @param TelegramBot\Api\BotApi $bot
*/
function sendMessageToAll($text = null, $chatid, $status, $db, $bot)
{
//this is use for hide confirm keyboard
$hideKeys = new \TelegramBot\Api\Types\ReplyKeyboardHide(true);
if ($status == 1) {
//confirm keyboard
$keys = new \TelegramBot\Api\Types\ReplyKeyboardMarkup(array(array("بله", "خیر")), false, true, true);
if ($text == null) {
//admin is going to send next message and next message stored
$db->orderBy('ID', 'DESC');
$q = $db->getOne('nextMessages', array('text'));
$text = $q['text'];
}
$db->update('adminOperations', array('message' => $text));
$status = 2;
//admin get confirm
$msg = "پیام زیر برای همه کاربران ارسال خواهد شد. آیا برای ارسال پیامها اطمینان دارید؟\n\n";
$msg .= $text;
$bot->sendMessage($chatid, $msg, true, null, $keys);
} elseif ($status == 2 && $text == 'بله') {
//get all user and send message for them
$users = $db->get('users');
$db->orderBy('ID', 'DESC');
//custom message and next message temporary stored in adminOperations table
$q = $db->getOne('adminOperations', array('message'));
$message = $q['message'];
foreach ($users as $user) {
try {
$bot->sendMessage($user['ID'], $message);
} catch (Exception $e) {
error_log($e->getMessage());
}
}
$bot->sendMessage($chatid, 'پیام مورد نظر ارسال شد', true, null, $hideKeys);
$status = 0;
} else {
$bot->sendMessage($chatid, 'ارسال پیام لغو شد', true, null, $hideKeys);
$status = 0;
}
$db->update('adminOperations', array('send_status' => $status));
}
示例2: Conf
?>
<main class="mdl-layout__content">
<div class="discover">
<h1 class="discover-text">Discover</h1>
</div>
<div class="main-section">
<center>
</center>
<?php
require 'conf.php';
require 'sql.php';
$c = new Conf();
$o = new MysqliDb($c->host, $c->username, $c->password, $c->db);
$o->orderBy('timeadded', 'desc');
$k = $o->get('startups', 20);
foreach ($k as $key => $value) {
?>
<div class="mdl-card mdl-shadow--2dp startup-card">
<div class="mdl-card__title mdl-card--expand startup-image" style="background-image:url('<?php
echo $value['imageurl'];
?>
');">
<div class="startup-overlay"></div>
<h2 class="mdl-card__title-text startup-name"><?php
echo $value['name'];
?>
</h2>
</div>
示例3: array
$sount = 0;
$i = 0;
$Error = '';
$neworderarray['0'] = "";
$neworderarray = array_merge($neworderarray, $_POST['neworder']);
unset($neworderarray['0']);
//loop through the list of ids and update your db
foreach ($neworderarray as $order => $id) {
$data = array('sort' => $order);
$db->where('id', $id);
if ($db->update('sob', $data)) {
$count++;
} else {
$Error = $Error . '' . $db->getLastError();
}
$i++;
}
if ($count != $i) {
echo $Error;
} else {
$sob = dbObject::table('sob')->get();
$db->orderBy("sort", "asc");
$sob = sob::get();
foreach ($sob as $s) {
$m[] = round($s->kef, 2);
}
echo '1-2 :' . round($m['0'] * $m['1'], 2) . '<br />';
echo '3-4 :' . round($m['2'] * $m['3'], 2) . '<br />';
echo '1-3 :' . round($m['0'] * $m['2'], 2) . '<br />';
echo '2-3 :' . round($m['1'] * $m['2'], 2) . '<br />';
}
示例4: getUserReport
public function getUserReport($uid)
{
$db = new MysqliDb(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$db->where('uid', $uid);
$db->orderBy("id", "Desc");
$result = $db->get("activities");
return $result;
}
示例5: catch
} catch (Exception $e) {
error_log("خطا در دریافت اطلاعات\n\n" . $e->getMessage());
}
$text = strtolower($text);
$bot = new TelegramBot\Api\BotApi(TOKEN);
try {
switch ($text) {
case '/start':
case '/start@softwaretalkbot':
$message = "سلام\nبه ربات جلسات باز نرم افزاری خوش آمدید.\nجهت اطلاع از جلسه آتی عبارت next را ارسال کنید.";
$bot->sendMessage($chatid, $message);
break;
case '/next':
case '/next@softwaretalkbot':
case 'next':
$db->orderBy('ID', 'DESC');
$q = $db->getOne('nextMessages');
$message = $q['text'];
$bot->sendMessage($chatid, $message);
break;
case '/about':
case '/about@softwaretalkbot':
case 'about':
$bot->sendMessage($chatid, "من اطلاعات جلسات باز نرم افزاری مشهد را برایتان ارسال میکنم.\n" . "سورس من روی گیت هاب قرار دارد. می توانید از طریق لینک زیر آن را مشاهده کنید:\n" . "https://github.com/mnameghi/SoftwareTalks");
break;
//set next message
//set next message
case COMMAND1:
case '/' . COMMAND1:
if (!isAdmin($chatid, $db)) {
return;
示例6: MysqliDb
<?php
include 'core.php';
?>
<?php
header::all();
?>
<?php
// Generate new unique ticket ID by fetching the primary ID of the last ticket &
// using a substring of the time() function to avoid duplicates
// New DB Connection
$db = new MysqliDb($dbserver, $dbusername, $dbpassword, $dbdatabase);
// Order by primary ID descending to ensure we fetch the final table row.
$db->orderBy("primary_id", "desc");
// Fetch the primary ID of the last ticket in the database
$last_ticket = $db->getValue("tickets", "primary_id");
// Create new unique ticket number for this ticket
$new_ticket_number = $last_ticket . substr(time(), 7, 10);
// Get current time in PHP - we use this as a simple method of catching spambots
$spambot_time = time();
?>
<h1 class='mendhub-logo corner-logo'><a href='http://<?php
echo $_SERVER[HTTP_HOST];
?>
'>Mend<span class='mendhub-sub-logo'>Hub</span></a></h1>
<div class="container-fluid">
<div class="row">
示例7: MysqliDb
<?php
require_once 'inc/MysqliDb.php';
require_once 'inc/Encryption.php';
ini_set("memory_limit", "200M");
$db = new MysqliDb();
$db->orderBy("id", "Desc");
$contracts = $db->get('contracts');
$encrypt = new Encryption();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="contract generater for ignitorlabs">
<meta name="author" content="anyun">
<title>Contract List</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- Custom styles for this template -->
<link href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css" rel="stylesheet">
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>