本文整理汇总了PHP中MySql::Instance方法的典型用法代码示例。如果您正苦于以下问题:PHP MySql::Instance方法的具体用法?PHP MySql::Instance怎么用?PHP MySql::Instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql
的用法示例。
在下文中一共展示了MySql::Instance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Get
static function Get($key = '')
{
if (count(self::$_settings) == 0) {
self::$_settings = MySql::Instance()->QuickArray("SELECT * FROM settings");
}
if (self::$_settings[$key] != null) {
return self::$_settings[$key];
}
return self::$_settings;
}
示例2: Login
<?php
/**
* Login Checker
*
* @author Sam Plugins <samplugins@gmail.com>
* @copyright Sam Plugins <samplugins@gmail.com>
* @twitter http://twitter.com/samplugins
*/
require_once "include/init.php";
if (CommonFunc::isPost()) {
$Login = new Login(MySql::Instance());
if ($Login->loginCheck(CommonFunc::safe($_POST['username']), CommonFunc::safe($_POST['password']))) {
echo "<script>window.location='donations.php'</script>";
} else {
$_SESSION['login-flash'] = "" . CommonFunc::ERROR . "|Invalid username and/or password";
echo "<script>window.location='login.php'</script>";
}
}
示例3: db
function db()
{
return MySql::Instance();
}
示例4: modDonations
<?php
$oDonation = new modDonations(MySql::Instance());
$donation_data = $oDonation->getPendingDonationData(session_id());
$donation_id = (int) $donation_data['donation_id'];
$q = CommonFunc::security_question();
$style_form = '';
$style_preview_form = ' style="display:none;"';
$preview_applicable = false;
$security_code = '';
if ($donation_id > 0 && isset($_GET['p']) && $_GET['p'] == 1) {
$style_preview_form = '';
$style_form = ' style="display:none;"';
$preview_applicable = true;
$security_code = $q['a'];
}
?>
<div id="div_donation_form"<?php
echo $style_form;
?>
>
<div id="donate_response_div" class="reponse_div no_display"></div>
<form method="post" id="donate_form" action="php/preview-process.php" class="WebForm">
<h2>Your Details</h2>
<p>
<label>First Name <em>*</em> <em id="err_first_name" class="error">required</em></label>
<span><input type="text" id="first_name" value="<?php
echo $donation_data['first_name'];
?>
示例5: while
<thead>
<tr>
<th width="2%" align="left"><input type='checkbox' name='checkall' onclick='checkUncheckAll(this);' class="check_radio" /></th>
<th width="15%" align="left">First Name</th>
<th width="15%" align="left">Last Name</th>
<th width="10%" align="center">Email</th>
<th width="20%" align="center">Date</th>
<th width="10%" align="center">Amount</th>
<th width="20%" align="center">Status</th>
<th width="28%" align="center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
while ($donation = MySql::Instance()->myArray($paging->result)) {
$class = CommonFunc::tr_class($i);
?>
<tr class="<?php
echo $class;
?>
">
<td width="2%">
<input type='hidden' name='visible_donation_ids[]' value='<?php
echo $donation['donation_id'];
?>
' />
<input type='checkbox' name='donation_ids[]' value='<?php
echo $donation['donation_id'];
?>
' class="check_radio" /></td>
示例6: modDonations
<?php
/**
* Delete Donation
*
* @author Sam Plugins <samplugins@gmail.com>
* @copyright Sam Plugins <samplugins@gmail.com>
* @twitter http://twitter.com/samplugins
*/
require_once "include/init.php";
if (CommonFunc::isGet() && isset($_GET['id'])) {
$contact = new modDonations(MySql::Instance());
if ($contact->Delete($_GET['id'])) {
$_SESSION['contact-request-flash'] = "" . CommonFunc::SUCCESS . "|Entry deleted successfully.";
} else {
$_SESSION['contact-request-flash'] = "" . CommonFunc::ERROR . "|Entry couldn't be deleted";
}
CommonFunc::redirect("donations.php");
} else {
echo "Invalid request!";
}
示例7: _process
private function _process()
{
$sql = "UPDATE admin_users SET password = '" . md5($this->_data['new_password']) . "' WHERE username = '" . $_SESSION['user'] . "'";
MySql::Instance()->query($sql);
}