本文整理汇总了PHP中MYSQL::QUERY方法的典型用法代码示例。如果您正苦于以下问题:PHP MYSQL::QUERY方法的具体用法?PHP MYSQL::QUERY怎么用?PHP MYSQL::QUERY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MYSQL
的用法示例。
在下文中一共展示了MYSQL::QUERY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Sales', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$Total = $CL['d_gross_nontaxable'] + $CL['d_gross_taxable'];
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $Total;
}
} else {
$T = Date_UTC($CT['d_date']);
$Total = $CT['d_gross_nontaxable'] + $CT['d_gross_taxable'];
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $Total;
}
if ($P === false) {
$STRING[0]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例2: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array();
if ($P === false) {
$I[] = STR_REPLACE("/", "-", $R) . " 00:00:00";
$I[] = STR_REPLACE("/", "-", $R) . " 24:59:59";
$SET = 'HOUR';
} else {
$R = explode(" - ", $R);
$I[] = STR_REPLACE("/", "-", $R[0]);
$I[] = STR_REPLACE("/", "-", $R[1]);
$SET = 'DAY';
}
$I[] = $S['s_id'];
$Q = "SELECT MIN(t_checkout_created) AS `time`, AVG(t_checkout_price) AS `cost` FROM core_tickets_processed WHERE t_checkout_created >= ? AND t_checkout_created <= ? AND t_store = ? GROUP BY";
$CA = MYSQL::QUERY($Q . " {$SET}(t_checkout_created) ORDER BY t_checkout_created ASC", $I);
$CO = MYSQL::QUERY($Q . " t_checkout_created ORDER BY t_checkout_created ASC", $I);
$STRING = array();
$STRING[] = array('name' => 'Average Charge', 'data' => '');
$STRING[] = array('name' => 'Checkout Charges', 'data' => '');
foreach ($CA as $C) {
$T = Date_UTC($C['time']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $T[3] . "," . $C['cost'];
}
foreach ($CO as $C) {
$T = Date_UTC($C['time']);
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $T[3] . "," . $T[4] . "," . $C['cost'];
}
echo JSON_ENCODE($STRING);
}
示例3: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Cash', 'data' => ''), array('name' => 'Check', 'data' => ''), array('name' => 'American Express', 'data' => ''), array('name' => 'Discover', 'data' => ''), array('name' => 'Master Card', 'data' => ''), array('name' => 'Visa', 'data' => ''), array('name' => 'Debit', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_cash'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_check'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_amex'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_discover'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_master'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_visa'];
$STRING[6]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_debit'];
}
} else {
$T = Date_UTC($CT['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_cash'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_check'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_amex'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_discover'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_master'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_visa'];
$STRING[6]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_debit'];
}
if ($P === false) {
$STRING[0]['type'] = 'column';
$STRING[1]['type'] = 'column';
$STRING[2]['type'] = 'column';
$STRING[3]['type'] = 'column';
$STRING[4]['type'] = 'column';
$STRING[5]['type'] = 'column';
$STRING[6]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例4: switch
require "../../../frame/engine.php";
ENGINE::START();
$USER = USER::VERIFY(0, TRUE);
if (empty($_GET['sSearch'])) {
$S = $_GET['string'];
} else {
$S = $_GET['sSearch'];
}
$iDS = $_GET['iDisplayStart'];
$iDL = $_GET['iDisplayLength'];
$iSC = $_GET['iSortCol_0'];
$iSD = $_GET['sSortDir_0'];
switch ($iSC) {
case 0:
$SS = 'ORDER BY c_name ' . $iSD;
break;
case 1:
$SS = 'ORDER BY c_phone ' . $iSD;
break;
case 2:
$SS = '';
break;
}
$iTotal = MYSQL::QUERY('SELECT COUNT(c_id) AS `COUNT` FROM core_customers WHERE c_name LIKE ? OR c_phone LIKE ?', array('%' . $S . '%', '%' . $S . '%'));
$iQuery = MYSQL::QUERY("SELECT * FROM core_customers WHERE c_name LIKE ? OR c_phone LIKE ? {$SS} LIMIT {$iDS},{$iDL}", array('%' . $S . '%', '%' . $S . '%'), FALSE, TRUE);
$OUTPUT = array('sEcho' => $_GET['sEcho'], 'iTotalRecords' => $iTotal[0]['COUNT'], 'iTotalDisplayRecords' => $iTotal[0]['COUNT'], 'aaData');
foreach ($iQuery as $C) {
$OUTPUT['aaData'][] = array($C['c_name'], FORMAT::PHONE($C['c_phone']), '<button onClick="LoadCustomer(' . "'" . $C['c_id'] . "'" . ')">LOAD</button>');
}
echo JSON_ENCODE($OUTPUT);
示例5: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(1);
$date = $_GET['date'];
$store = $_GET['store'];
$NOTES = MYSQL::QUERY("SELECT ctn.t_note FROM core_tickets_status cts JOIN core_tickets_note ctn ON cts.t_id = ctn.t_id AND ctn.t_note LIKE ? WHERE t_store = ?", array('%Walkedout Ticket%', $STORE, $SD, $ED));
示例6: array
$CHECKOUT = MYSQL::QUERY("SELECT * FROM core_checkout_sessions WHERE qb_id = ? LIMIT 1", array($_GET['chid']));
$ITEMS = EXPLODE('|', $CHECKOUT['items']);
$LIST = '';
$IT = 1;
$oldnontaxable = 0;
$nontaxable = 0;
$oldtaxable = 0;
$taxable = 0;
$oldtotaltax = 0;
$totaltax = 0;
foreach ($ITEMS as $I) {
if ($I != '') {
$I = EXPLODE('/', $I);
$LIST .= '|' . $I[0] . '/' . $_GET['item' . $IT];
$EX = EXPLODE('-', $I[0]);
if ($EX[0] == 'ti') {
MYSQL::QUERY('UPDATE core_tickets_processed SET t_checkout_created=?,t_checkout_price=? WHERE t_id=? LIMIT 1', array($_GET['date'], $_GET['item' . $IT], $EX[1]));
$nontaxable = $nontaxable + ($_GET['item' . $IT] - 0);
$oldnontaxable = $oldnontaxable + $I[1];
} else {
$taxable = $taxable + ($_GET['item' . $IT] - 0);
$totaltax = $totaltax + ($_GET['item' . $IT] - 0) / 100 * $user['store_info']['s_taxrate'];
$oldtaxable = $oldtaxable + $I[1];
$oldtotaltax = $I[1] / 100 * $user['store_info']['s_taxrate'];
}
}
$IT++;
}
MYSQL::QUERY('UPDATE core_checkout_sessions SET items=?,pm_1=?,pm_1_cost=?,pm_2=?,pm_2_cost=?,d_date=? WHERE qb_id=? LIMIT 1', array($LIST, $_GET['pm_1'], $_GET['pm_1_charge'], $_GET['pm_2'], $_GET['pm_2_charge'], $_GET['date'], $_GET['chid']));
TRACKING::CHECKOUTS($oldnontaxable, $oldtaxable, $oldtotaltax, $user, $CHECKOUT['pm_1'], $CHECKOUT['pm_1_cost'], $CHECKOUT['pm_2'], $CHECKOUT['pm_2_cost'], '-', $_GET['date']);
TRACKING::CHECKOUTS($nontaxable, $taxable, $totaltax, $user, $_GET['pm_1'], $_GET['pm_1_charge'], $_GET['pm_2'], $_GET['pm_2_charge'], '+', $_GET['date']);
示例7: mysql_escape_string
}
}
}
if ($i == 1) {
$comma = ' ';
} else {
$comma = ', ';
}
$added .= "{$name}<br/><br/>";
$query .= $comma . '("' . $man[1] . '", "' . $type . '", "' . mysql_escape_string($name) . '", "' . mysql_escape_string($img) . '", "' . mysql_escape_string($also) . '", "' . $date . '")';
$i++;
}
if ($query == 'INSERT IGNORE INTO device_models (m_manufacturer_id, m_type, m_name, m_link, m_known, m_date) VALUES') {
break;
}
MYSQL::QUERY($query);
$a++;
}
if ($type == 4) {
break;
}
$type++;
}
}
?>
<form method='post'>
<select name='manu'><?php
echo $options;
?>
</select><input type='submit' name='submit' value='submit'>
</form>
示例8: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$load = $_GET['load'];
$Main = MYSQL::QUERY('SELECT m_name FROM device_manufacturers WHERE m_id = ? LIMIT 1', array($load));
$manu = $Main['m_name'];
$Main = MYSQL::QUERY('SELECT m_id, m_name FROM device_models WHERE m_manufacturer_id = ? ORDER BY m_name ASC', array($load));
$i = 0;
$options = "";
foreach ($Main as $b) {
$model = str_replace($manu . ' ', '', $b['m_name']);
$options .= "<option value='" . $b['m_id'] . "'>" . $model . "</option>";
$i++;
}
echo '<option value="">' . $i . ' Model(s) Found...</option>' . $options;
示例9: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$usera = USER::VERIFY(0, TRUE);
$M = $_GET['m'];
$OPTIONS = MYSQL::QUERY('SELECT dpl.id,dpl.name FROM device_models dm JOIN device_parts_list dpl ON dm.m_type = dpl.cat WHERE m_id = ? ORDER BY dpl.name ASC', array($M));
?>
<center>
<form id="addnewpartform">
<select name="addpart" style="width:250px;" data-placeholder="Select Part..." class="required" onChange='RemoveError($(this))'>
<option value=""></option>
<?php
foreach ($OPTIONS as $O) {
echo '<option value="' . $O["id"] . '">' . $O["name"] . '</option>';
}
?>
</select><br/><br/>
<select name="partcolor" style="width:250px;" data-placeholder="Select Color..." class="required" onChange='RemoveError($(this))'>
<option value=""></option>
<option value="None">None</option>
<option value="Black">Black</option>
<option value="White">White</option>
<option value="Red">Red</option>
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="Orange">Orange</option>
<option value="Gray">Gray</option>
<option value="Purple">Purple</option>
<option value="Yellow">Yellow</option>
</select><br/><br/>
示例10: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$t = "'";
$params = array($_GET['m']);
$Main = MYSQL::QUERY('SELECT * FROM device_parts WHERE p_model_id = ? AND p_entry = 1 ORDER BY p_name ASC', $params);
?>
<script>
function FilterParts() {
var list = $("#part-list");
var filter = $("#part_search").val().toUpperCase();
if (filter) {
$(list).find(".name:not(:contains(" + filter + "))").parent().parent().slideUp();
$(list).find(".name:contains(" + filter + ")").parent().parent().slideDown();
$('#part_close').addClass('opened').removeClass('closed');
$('.ln-no-match').hide();
} else {
$(list).find("li").slideDown();
$('.ln-no-match').hide();
}
}
</script>
<div class="txt_dsb">
<div class="txt_dsb_fix">
<input type="text" id="part_search" onKeyUp="FilterParts()" placeholder="Filter Parts...">
<div id="part_close" onClick="$('#part_search').val('');$('#part_close').removeClass('opened').addClass('closed');FilterParts();" class="close closed"></div>
</div>
</div>
<div class="side-divider"></div>
示例11: foreach
<th>Identifyer</th>
<th>Price</th>
<th>Unlocked Price</th>
<th>Service</th>
<th>Store</th>
<th>Edit</th>
</thead>
<tbody style="background-color:white;">
<?php
$RD = MYSQL::QUERY('SELECT * FROM core_refurb_devices WHERE d_sold = 0 ORDER BY d_store ASC');
$STOREID = '';
$STORE = '';
foreach ($RD as $D) {
if ($STOREID == $D['d_store']) {
} else {
$STORE = MYSQL::QUERY('SELECT s_name FROM core_stores WHERE s_id = ? LIMIT 1', array($D['d_store']));
}
if ($D['d_unlocked_price'] > $D['d_locked_price']) {
$ULP = $D['d_unlocked_price'];
} else {
$ULP = '';
}
echo '
<tr class="rrt' . $D['d_id'] . '">
<td>' . $D['d_id'] . '</td>
<td>' . $D['d_model'] . '</td>
<td>' . $D['d_iden'] . '</td>
<td class="lop">' . $D['d_locked_price'] . '</td>
<td class="ulp">' . $ULP . '</td>
<td>' . $D['d_service_provider'] . '</td>
<td>' . $STORE['s_name'] . '</td>
示例12: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$params = array('%' . $_GET['m'] . '%', '%' . $_GET['m'] . '%');
$Main = MYSQL::QUERY('SELECT * FROM device_models WHERE m_name LIKE ? OR m_known LIKE ? ORDER BY m_name ASC', $params);
?>
<div class="txt_dsb">
<div class="txt_dsb_fix">
<input type="text" id="model_search" onKeyUp="SearchModel(event)" placeholder="Search Model...">
<div id="model_close" onClick="$('#model_search').val('');$('#model_close').removeClass('opened').addClass('closed');" class="close closed"></div>
</div>
</div>
<script>$("#model-list").listnav({showCounts: false});</script><center><div id="model-list-nav"></div></center><ul id="model-list">
<?php
if (!empty($Main)) {
foreach ($Main as $a) {
$newname = $a['m_name'];
if (strlen($newname) > 25) {
$newname_modded = substr($newname, 0, 25);
$newname_modded = "{$newname_modded}...";
} else {
$newname_modded = $newname;
}
$l = "'";
if ($a['m_link'] == "") {
$databutton = '';
} else {
$databutton = '<div class="mod-info-button" onClick="ShowModInfo(' . $l . '' . $newname . '' . $l . ',' . $l . '' . $a['m_link'] . '' . $l . ')"></div>';
}
示例13: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$ticket = $_GET['tid'];
$Main = MYSQL::QUERY("SELECT * FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($ticket));
$items = $Main['t_estimate_items'];
$items1 = explode("|", $items);
$ns = "";
foreach ($items1 as $i) {
if (!empty($i)) {
$i = explode("-", $i);
if ($i[0] == "it") {
MYSQL::QUERY("UPDATE inventory_stock SET quantity = quantity - 1 WHERE item=? AND store=? LIMIT 1", array($i[1], $user['store']));
$Quan = MYSQL::QUERY("SELECT * FROM inventory_stock WHERE item=? AND store=? LIMIT 1", array($i[1], $user['store']));
print_r($Quan);
if ($Quan > 0) {
$ns .= $i[1] . "|";
}
}
}
}
if (!$ns == "") {
MYSQL::QUERY("UPDATE core_tickets_status SET t_order = ? WHERE t_id = ? LIMIT 1;", array($ns, $ticket));
}
MYSQL::QUERY("UPDATE core_tickets_status SET t_reserved = 1 WHERE t_id = ? LIMIT 1", array($ticket));
TRACKING::ACCEPTS($user);
示例14: FORMAT
public static function FORMAT($S, $R, $P)
{
$I = array($S['s_id']);
if ($P === false) {
$TI = "AND d_date = ? LIMIT 1";
$I[] = str_replace("/", "-", $R);
} else {
$R = explode(" - ", $R);
$TI = "AND d_date >= ? AND d_date <= ? ORDER BY d_date ASC";
$I[] = str_replace("/", "-", $R[0]);
$I[] = str_replace("/", "-", $R[1]);
}
$CT = MYSQL::QUERY("SELECT * FROM core_stores_daily_tickets WHERE s_id = ? {$TI}", $I);
$AE = MYSQL::QUERY("SELECT * FROM core_stores_daily_accepts WHERE s_id = ? {$TI}", $I);
$WT = MYSQL::QUERY("SELECT * FROM core_stores_daily_walkouts WHERE s_id = ? {$TI}", $I);
$CD = MYSQL::QUERY("SELECT * FROM core_stores_daily_checkouts WHERE s_id = ? {$TI}", $I);
$RD = MYSQL::QUERY("SELECT * FROM core_stores_daily_repairs WHERE s_id = ? {$TI}", $I);
$CC = MYSQL::QUERY("SELECT * FROM core_stores_daily_customers WHERE s_id = ? {$TI}", $I);
$STRING = array(array('name' => 'Created Tickets', 'data' => ''), array('name' => 'Accepted Estimates', 'data' => ''), array('name' => 'Walked Out Tickets', 'data' => ''), array('name' => 'Checked Out Tickets', 'data' => ''), array('name' => 'Repaired Devices', 'data' => ''), array('name' => 'Customer Accounts Created', 'data' => ''));
if (!$P === false) {
foreach ($CT as $CL) {
$T = Date_UTC($CL['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CL['d_key'];
}
foreach ($AE as $A) {
$T = Date_UTC($A['d_date']);
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $A['d_key'];
}
foreach ($WT as $W) {
$T = Date_UTC($W['d_date']);
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $W['d_key'];
}
foreach ($CD as $C) {
$T = Date_UTC($C['d_date']);
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $C['d_key'];
}
foreach ($RD as $R) {
$T = Date_UTC($R['d_date']);
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $R['d_key'];
}
foreach ($CC as $C) {
$T = Date_UTC($C['d_date']);
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $C['d_key'];
}
} else {
$T = Date_UTC($CT['d_date']);
$STRING[0]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CT['d_key'];
$STRING[1]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $AE['d_key'];
$STRING[2]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $WT['d_key'];
$STRING[3]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CD['d_key'];
$STRING[4]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $RD['d_key'];
$STRING[5]['data'][] .= $T[0] . "," . $T[1] . "," . $T[2] . "," . $CC['d_key'];
}
if ($P === false) {
$STRING[0]['type'] = 'column';
$STRING[1]['type'] = 'column';
$STRING[2]['type'] = 'column';
$STRING[3]['type'] = 'column';
$STRING[4]['type'] = 'column';
$STRING[5]['type'] = 'column';
}
echo JSON_ENCODE($STRING);
}
示例15: array
<?php
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$load = $_GET['nmb'];
$params = array($load);
$Main = MYSQL::QUERY('SELECT l_id,l_name FROM core_advert_locations WHERE l_method = ? ORDER BY l_name ASC', $params);
foreach ($Main as $b) {
echo "<option value='" . $b['l_id'] . "'>" . $b['l_name'] . "</option>";
}