本文整理汇总了PHP中mysql_update函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_update函数的具体用法?PHP mysql_update怎么用?PHP mysql_update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_optimize
function db_optimize()
{
global $WORKING, $STATIC;
trigger_error(sprintf(__('%d. try for database optimize...', 'backwpup'), $WORKING['DB_OPTIMIZE']['STEP_TRY']), E_USER_NOTICE);
if (!isset($WORKING['DB_OPTIMIZE']['DONETABLE']) or !is_array($WORKING['DB_OPTIMIZE']['DONETABLE'])) {
$WORKING['DB_OPTIMIZE']['DONETABLE'] = array();
}
mysql_update();
//to backup
$tabelstobackup = array();
$result = mysql_query("SHOW TABLES FROM `" . $STATIC['WP']['DB_NAME'] . "`");
//get table status
if (!$result) {
trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR);
}
while ($data = mysql_fetch_row($result)) {
if (!in_array($data[0], $STATIC['JOB']['dbexclude'])) {
$tabelstobackup[] = $data[0];
}
}
//Set num of todos
$WORKING['STEPTODO'] = count($tabelstobackup);
if (count($tabelstobackup) > 0) {
maintenance_mode(true);
foreach ($tabelstobackup as $table) {
if (in_array($table, $WORKING['DB_OPTIMIZE']['DONETABLE'])) {
continue;
}
$result = mysql_query('OPTIMIZE TABLE `' . $table . '`');
if (!$result) {
trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "OPTIMIZE TABLE `" . $table . "`"), E_USER_ERROR);
continue;
}
$optimize = mysql_fetch_assoc($result);
$WORKING['DB_OPTIMIZE']['DONETABLE'][] = $table;
$WORKING['STEPDONE'] = count($WORKING['DB_OPTIMIZE']['DONETABLE']);
if ($optimize['Msg_type'] == 'error') {
trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_ERROR);
} elseif ($optimize['Msg_type'] == 'warning') {
trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_WARNING);
} else {
trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_NOTICE);
}
}
trigger_error(__('Database optimize done!', 'backwpup'), E_USER_NOTICE);
maintenance_mode(false);
} else {
trigger_error(__('No tables to optimize', 'backwpup'), E_USER_WARNING);
}
$WORKING['STEPSDONE'][] = 'DB_OPTIMIZE';
//set done
}
示例2: update_option
function update_option($option = 'backwpup_jobs', $data)
{
global $WORKING, $STATIC;
mysql_update();
$serdata = mysql_real_escape_string(serialize($data));
$query = "UPDATE " . $STATIC['WP']['OPTIONS_TABLE'] . " SET option_value= '" . $serdata . "' WHERE option_name='" . trim($option) . "' LIMIT 1";
$res = mysql_query($query);
if (!$res) {
trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), $query), E_USER_ERROR);
return false;
}
return true;
}
示例3: verifyUser
protected function verifyUser($args)
{
if ($args['msisdn'] == '' || $args['number'] == '') {
return array('error' => 1, 'message' => 'Mandatory field missing');
}
$verifyEmailQry = "select ver_number from register where email = '" . $args['msisdn'] . "@mobifyi.com'";
$verifyEmailRes = mysql_query($verifyEmailQry, $this->db->conn);
$verifyRow = mysql_fetch_assoc($verifyEmailRes);
if ($verifyRow['ver_number'] == $args['number']) {
$updateVerificationNumberQry = "update ver_number = '' where msisdn = '" . $args['msisdn'] . "'";
mysql_update($updateVerificationNumberQry, $this->db->conn);
return array('error' => 0, 'message' => 'Verified Successfully');
} else {
return array('error' => 1, 'message' => 'Verification failed');
}
}
示例4: cron_logErrorsOnDieOrExit
function cron_logErrorsOnDieOrExit()
{
if (!@$GLOBALS['CRON_JOB_LOG_NUM']) {
return;
}
$summary = t("Returned errors");
$output = ob_get_clean();
$runtime = sprintf("%0.2f", microtime(true) - $GLOBALS['CRON_JOB_START']);
// update job log entry
mysql_update('_cron_log', $GLOBALS['CRON_JOB_LOG_NUM'], null, array('summary' => $summary, 'output' => $output, 'runtime' => $runtime));
// send email
$secondsAgo = time() - $GLOBALS['SETTINGS']['bgtasks_lastEmail'];
if ($secondsAgo >= 60 * 60) {
// don't email more than once an hour
// get email placeholders
$cronLog = mysql_get('_cron_log', $GLOBALS['CRON_JOB_LOG_NUM']);
$placeholders = array('bgtask.date' => $cronLog['createdDate'], 'bgtask.activity' => $cronLog['activity'], 'bgtask.summary' => nl2br(htmlencode($cronLog['summary'])), 'bgtask.completed' => $cronLog['completed'], 'bgtask.function' => $cronLog['function'], 'bgtask.output' => nl2br(htmlencode($cronLog['output'])), 'bgtask.runtime' => $cronLog['runtime'], 'bgtask.function' => $cronLog['function'], 'bgtasks.logsUrl' => realUrl("?menu=_cron_log", $GLOBALS['SETTINGS']['adminUrl']), 'bgtasks.settingsUrl' => realUrl("?menu=admin&action=general#background-tasks", $GLOBALS['SETTINGS']['adminUrl']));
// send message
$errors = sendMessage(emailTemplate_loadFromDB(array('template_id' => 'CMS-BGTASK-ERROR', 'placeholders' => $placeholders)));
if ($errors) {
die("Mail Error: {$errors}");
}
// update last emailed time
$GLOBALS['SETTINGS']['bgtasks_lastEmail'] = time();
saveSettings();
}
}
示例5: mysql_update
<?php
include "../../includes/sessionAdmin.php";
include "../../includes/conexion.php";
include "../../includes/mysql_util.php";
$matricula = $_POST["matricula"];
$nombres = $_POST["nombres"];
$APaterno = $_POST["APaterno"];
$AMaterno = $_POST["AMaterno"];
$FechaNacimiento = $_POST["FechaNacimiento"];
$CURP = $_POST["CURP"];
$Enfermedades = $_POST["Enfermedades"];
$Alergias = $_POST["Alergias"];
$Telefono = $_POST["Telefono"];
$Email = $_POST["Email"];
$estudios = $_POST["estudios"];
$result = mysql_update("maestro", array('m_nombre' => $nombres, 'm_apellidopaterno' => $APaterno, 'm_apellidomaterno' => $AMaterno, 'm_fechanac' => $FechaNacimiento, 'm_curp' => $CURP, 'm_enfermedades' => $Enfermedades, 'm_alergias' => $Alergias, 'm_numlocal' => $Telefono, 'm_email' => $Email, 'm_estudios' => $estudios), $matricula);
if (mysql_affected_rows() > 0) {
$alertMsg = "Maestro actualizado satisfactoriamente";
} elseif (!$result) {
$alertMsg = "Algo salio mal: " . mysql_error();
} else {
$alertMsg = "No encontramos ningun maestro con la matricula m{$matricula} o no hubo cambios en la informacion";
}
echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.location.href = \"../../vistas/menus/menuAdmin.php\"\n\t\t\t</script>";
示例6: sha1
$password = sha1($newpass);
} else {
// TFS 0.3/4
if (config('salt') === true) {
$saltdata = mysql_select_single("SELECT `salt` FROM `accounts` WHERE `email`='{$email}' LIMIT 1;");
if ($saltdata !== false) {
$salt .= $saltdata['salt'];
}
}
$password = sha1($salt . $newpass);
}
$user = mysql_select_single("SELECT `p`.`id` AS `player_id`, `a`.`name`, `a`.`id` AS `account_id` FROM `players` `p` INNER JOIN `accounts` `a` ON `p`.`account_id` = `a`.`id` WHERE `p`.`name` = '{$character}' AND `a`.`email` = '{$email}' AND `a`.`name` = '{$username}' LIMIT 1;");
if ($user !== false) {
// Found user
// Give him the new password
mysql_update("UPDATE `accounts` SET `password`='{$password}' WHERE `id`='" . $user['account_id'] . "' LIMIT 1;");
// Send him a mail with the new password
$mailer = new Mail($config['mailserver']);
$title = "{$_SERVER['HTTP_HOST']}: Your new password";
$body = "<h1>Account Recovery</h1>";
$body .= "<p>Your new password is: <b>{$newpass}</b><br>";
$body .= "We recommend you to login and change it before you continue playing. <br>";
$body .= "Enjoy your stay at " . $config['mailserver']['fromName'] . ". <br>";
$body .= "<hr>I am an automatic no-reply e-mail. Any emails sent back to me will be ignored.</p>";
$mailer->sendMail($email, $title, $body, $user['name']);
?>
<h1>Account Found!</h1>
<p>We have sent your new password to <b><?php
echo $email;
?>
</b>.</p>
示例7: explode
/**
* If config is set to store local version of file, store it
*/
if ($store_local) {
// Split text/html; charset=UTF-8
$type_info = explode("; ", $page_data['type']);
// Only store 'text/html' files
// TO DO enable range of file types to save
if ($type_info[0] == 'text/html') {
$data['html'] = $page_data['html'];
}
}
/**
* Store data
*/
mysql_update('urls', $data, array('ID' => $id));
/**
* If in debug mode, close the <ul> we opened above
*/
if (isset($_GET['debug'])) {
echo "</ul>";
}
}
//End foreach URL
}
//End While uncrawled URLs
/**
* If we're done, let the user know the good news
*/
if (sizeof($urls) == 0) {
echo "<p>No URLs to crawl!</p>";
示例8: protect_page
require_once 'engine/init.php';
include 'layout/overall/header.php';
protect_page();
admin_only($user_data);
// Declare as int
$view = isset($_GET['view']) && (int) $_GET['view'] > 0 ? (int) $_GET['view'] : false;
if ($view !== false) {
if (!empty($_POST['reply_text'])) {
sanitize($_POST['reply_text']);
// Save ticket reply on database
$query = array('tid' => $view, 'username' => getValue($_POST['username']), 'message' => getValue($_POST['reply_text']), 'created' => time());
$fields = '`' . implode('`, `', array_keys($query)) . '`';
$data = '\'' . implode('\', \'', $query) . '\'';
mysql_insert("INSERT INTO `znote_tickets_replies` ({$fields}) VALUES ({$data})");
mysql_update("UPDATE `znote_tickets` SET `status`='Staff-Reply' WHERE `id`='{$view}' LIMIT 1;");
}
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='{$view}' LIMIT 1;");
?>
<h1>View Ticket #<?php
echo $ticketData['id'];
?>
</h1>
<table class="znoteTable ThreadTable table table-striped">
<tr class="yellow">
<th>
<?php
echo getClock($ticketData['creation'], true);
?>
- Created by:
<?php
示例9: time
$bidend = time() + $config['houseConfig']['auctionPeriod'];
mysql_update("UPDATE `houses` SET `highest_bidder`='" . $player['id'] . "', `bid`='{$bid_amount}', `last_bid`='{$lastbid}', `bid_end`='{$bidend}' WHERE `id`='" . $house['id'] . "' LIMIT 1;");
$house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='" . $house['id'] . "';");
}
echo "<b><font color='green'>You have the highest bid on this house!</font></b>";
} else {
echo "<b><font color='red'>You need to place a bid that is higher or equal to {$minbid}gp.</font></b>";
}
} else {
// Check if current bid is higher than last_bid
if ($bid_amount > $house['last_bid']) {
// Should only apply to external players, allowing a player to up his pledge without
// being forced to pay his full previous bid.
if ($house['highest_bidder'] != $player['id']) {
$lastbid = $bid_amount + 1;
mysql_update("UPDATE `houses` SET `last_bid`='{$lastbid}' WHERE `id`='" . $house['id'] . "' LIMIT 1;");
$house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='" . $house['id'] . "';");
echo "<b><font color='orange'>Unfortunately your bid was not higher than previous bidder.</font></b>";
} else {
echo "<b><font color='orange'>You already have a higher pledge on this house.</font></b>";
}
} else {
echo "<b><font color='red'>Too low bid amount, someone else has a higher bid active.</font></b>";
}
}
} else {
echo "<b><font color='red'>You don't have enough money to bid this high.</font></b>";
}
} else {
echo "<b><font color='red'>Your character is to low level, must be higher level than ", $config['houseConfig']['levelToBuyHouse'] - 1, " to buy a house.</font></b>";
}
示例10: mysql_update
<?php
include "../../includes/sessionAdmin.php";
include "../../includes/conexion.php";
include "../../includes/mysql_util.php";
$matricula = $_POST["matricula"];
$descripcion = $_POST["descripcion"];
$result = mysql_update("periodo", $conexion, array('per_desc' => $descripcion), $matricula);
if (!$result) {
$alertMsg = "Algo salio mal: " . mysqli_error($conexion);
} else {
$alertMsg = "Periodo actualizado satisfactoriamente";
}
echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.history.go(-2);\n\t\t\t</script>";
示例11: _errorlog_sendEmailAlert
function _errorlog_sendEmailAlert()
{
if (!$GLOBALS['SETTINGS']['advanced']['phpEmailErrors']) {
return;
}
// once run function once per page-view
static $alreadySent = false;
if ($alreadySent) {
return;
}
$alreadySent = true;
// check if email sent in last hour
$sentInLastHour = mysql_count('_error_log', " `dateLogged` > (NOW() - INTERVAL 1 HOUR) AND email_sent = 1");
// send hourly alert
if (!$sentInLastHour) {
// send email
$secondsAgo = time() - $GLOBALS['SETTINGS']['bgtasks_lastEmail'];
if ($secondsAgo >= 60 * 60) {
// don't email more than once an hour
// get date format
if ($GLOBALS['SETTINGS']['dateFormat'] == 'dmy') {
$dateFormat = "jS M, Y - h:i:s A";
} elseif ($GLOBALS['SETTINGS']['dateFormat'] == 'mdy') {
$dateFormat = "M jS, Y - h:i:s A";
} else {
$dateFormat = "M jS, Y - h:i:s A";
}
// load latest error list
$latestErrors = mysql_select('_error_log', "`dateLogged` > (NOW() - INTERVAL 1 HOUR) ORDER BY `dateLogged` DESC LIMIT 25");
$latestErrorsList = '';
foreach ($latestErrors as $thisError) {
$latestErrorsList .= date($dateFormat, strtotime($thisError['dateLogged'])) . "\n";
$latestErrorsList .= $thisError['error'] . "\n";
$latestErrorsList .= $thisError['filepath'] . " (line " . $thisError['line_num'] . ")\n";
$latestErrorsList .= $thisError['url'] . "\n\n";
}
// set email_sent flag for ALL records
mysql_update('_error_log', null, 'TRUE', array('email_sent' => 1));
// send email message
$placeholders = array('error.hostname' => parse_url($GLOBALS['SETTINGS']['adminUrl'], PHP_URL_HOST), 'error.latestErrorsList' => nl2br(htmlencode($latestErrorsList)), 'error.errorLogUrl' => realUrl("?menu=_error_log", $GLOBALS['SETTINGS']['adminUrl']));
$errors = sendMessage(emailTemplate_loadFromDB(array('template_id' => 'CMS-ERRORLOG-ALERT', 'placeholders' => $placeholders)));
// log/display email sending errors
if ($errors) {
trigger_error("Unable to send error notification email from " . __FUNCTION__ . ": {$errors}", E_USER_NOTICE);
die(__FUNCTION__ . ": {$errors}");
}
}
}
}
示例12: verify_account
/**
* verify account
*
* @param mixed $email
* @param mixed $code
*/
function verify_account($email, $code, $data = array())
{
global $conn;
$rs = mysql_query('select * from crx_demo_users where email="' . mysql_real_escape_string($email) . '" and activation_code="' . mysql_real_escape_string($code) . '"', $conn);
if (mysql_num_rows($rs)) {
$update = array('verify' => '1');
if (is_array($data) && count($data)) {
$update = array_merge($update, $data);
}
mysql_update('crx_demo_users', $update, 'email="' . mysql_real_escape_string($email) . '"');
return true;
}
return false;
}
示例13: db_dump
function db_dump()
{
global $WORKING, $STATIC;
trigger_error(sprintf(__('%d. try for database dump...', 'backwpup'), $WORKING['DB_DUMP']['STEP_TRY']), E_USER_NOTICE);
if (!isset($WORKING['DB_DUMP']['DONETABLE']) or !is_array($WORKING['DB_DUMP']['DONETABLE'])) {
$WORKING['DB_DUMP']['DONETABLE'] = array();
}
mysql_update();
//to backup
$tabelstobackup = array();
$result = mysql_query("SHOW TABLES FROM `" . $STATIC['WP']['DB_NAME'] . "`");
//get table status
if (!$result) {
trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR);
}
while ($data = mysql_fetch_row($result)) {
if (!in_array($data[0], $STATIC['JOB']['dbexclude'])) {
$tabelstobackup[] = $data[0];
}
}
$WORKING['STEPTODO'] = count($tabelstobackup);
//Set maintenance
maintenance_mode(true);
if (count($tabelstobackup) > 0) {
$result = mysql_query("SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`");
//get table status
if (!$result) {
trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR);
}
while ($data = mysql_fetch_assoc($result)) {
$status[$data['Name']] = $data;
}
if ($file = fopen($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql', 'wb')) {
fwrite($file, "-- ---------------------------------------------------------\n");
fwrite($file, "-- Dump with BackWPup ver.: " . $STATIC['BACKWPUP']['VERSION'] . "\n");
fwrite($file, "-- Plugin for WordPress " . $STATIC['WP']['VERSION'] . " by Daniel Huesken\n");
fwrite($file, "-- http://backwpup.com/\n");
fwrite($file, "-- Blog Name: " . $STATIC['WP']['BLOGNAME'] . "\n");
fwrite($file, "-- Blog URL: " . $STATIC['WP']['SITEURL'] . "\n");
fwrite($file, "-- Blog ABSPATH: " . $STATIC['WP']['ABSPATH'] . "\n");
fwrite($file, "-- Table Prefix: " . $STATIC['WP']['TABLE_PREFIX'] . "\n");
fwrite($file, "-- Database Name: " . $STATIC['WP']['DB_NAME'] . "\n");
fwrite($file, "-- Dump on: " . date('Y-m-d H:i.s', time() + $STATIC['WP']['TIMEDIFF']) . "\n");
fwrite($file, "-- ---------------------------------------------------------\n\n");
//for better import with mysql client
fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n");
fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n");
fwrite($file, "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");
fwrite($file, "/*!40101 SET NAMES '" . mysql_client_encoding() . "' */;\n");
fwrite($file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n");
fwrite($file, "/*!40103 SET TIME_ZONE='" . mysql_result(mysql_query("SELECT @@time_zone"), 0) . "' */;\n");
fwrite($file, "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n");
fwrite($file, "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n");
fwrite($file, "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n");
fwrite($file, "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n");
//make table dumps
foreach ($tabelstobackup as $table) {
if (in_array($table, $WORKING['DB_DUMP']['DONETABLE'])) {
continue;
}
_db_dump_table($table, $status[$table], $file);
$WORKING['DB_DUMP']['DONETABLE'][] = $table;
$WORKING['STEPDONE'] = count($WORKING['DB_DUMP']['DONETABLE']);
}
//for better import with mysql client
fwrite($file, "\n");
fwrite($file, "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n");
fwrite($file, "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
fwrite($file, "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n");
fwrite($file, "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
fwrite($file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n");
fwrite($file, "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n");
fwrite($file, "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
fwrite($file, "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
fclose($file);
trigger_error(__('Database dump done!', 'backwpup'), E_USER_NOTICE);
} else {
trigger_error(__('Can not create database dump!', 'backwpup'), E_USER_ERROR);
}
} else {
trigger_error(__('No tables to dump', 'backwpup'), E_USER_WARNING);
}
//add database file to backupfiles
if (is_readable($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql')) {
$filestat = stat($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql');
trigger_error(sprintf(__('Add database dump "%1$s" with %2$s to backup file list', 'backwpup'), $STATIC['WP']['DB_NAME'] . '.sql', formatbytes($filestat['size'])), E_USER_NOTICE);
$WORKING['ALLFILESIZE'] += $filestat['size'];
add_file(array(array('FILE' => $STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql', 'OUTFILE' => $STATIC['WP']['DB_NAME'] . '.sql', 'SIZE' => $filestat['size'], 'ATIME' => $filestat['atime'], 'MTIME' => $filestat['mtime'], 'CTIME' => $filestat['ctime'], 'UID' => $filestat['uid'], 'GID' => $filestat['gid'], 'MODE' => $filestat['mode'])));
}
//Back from maintenance
maintenance_mode(false);
$WORKING['STEPSDONE'][] = 'DB_DUMP';
//set done
}
示例14: session_start
<?php
session_start();
include 'functions.php';
$code = $_REQUEST['code'];
//sub
$subcode = $_REQUEST['subCode'];
//subcode
$sender = $_REQUEST['mobile'];
$servNum = $_REQUEST['serviceNumber'];
//service number
$mess = $_REQUEST['info'];
//message
//generate code
$code = RandomString(10);
if (count(select_sql('select * from crx_demo_users where phone="' . $sender . '"'))) {
//update
mysql_update('crx_demo_users', array('verify' => '1', 'activation_code' => $code), 'phone="' . $sender . '"');
} else {
//add new demo
//add user to crx_demo_users table
$id = mysql_insert('crx_demo_users', array('phone' => $sender, 'verify' => '1', 'activation_code' => $code));
//add advertising data to crx_ads
mysql_insert('crx_ads', array('user' => $id));
}
//0 là sms dạng text
$resp = "0|Your Code:" . $code . ' Login URL: http://app-ads.hoangweb.com/ksn-crx/admin.php';
echo $resp;
示例15: mysql_update
}
if (isset($_POST['bajaGrupoCursos'])) {
$bajaGrupoCursos = 1;
$_SESSION['bajaGrupoCursos'] = 1;
} else {
$bajaGrupoCursos = 0;
$_SESSION['bajaGrupoCursos'] = 0;
}
if (isset($_POST['cambioGrupoCursos'])) {
$cambioGrupoCursoselds = 1;
$_SESSION['cambioGrupoCursos'] = 1;
} else {
$cambioGrupoCursoselds = 0;
$_SESSION['cambioGrupoCursos'] = 0;
}
if (isset($_POST['verReportes'])) {
$verReportes = 1;
$_SESSION['verReportes'] = 1;
} else {
$verReportes = 0;
$_SESSION['verReportes'] = 0;
}
$result = mysql_update("permiso", $conexion, array('p_aAdmin' => $altaAdmin, 'p_bAdmin' => $bajaAdmin, 'p_cAdmin' => $cambioAdmin, 'p_aMaestro' => $altaMaestro, 'p_bMaestro' => $bajaMaestro, 'p_cMaestro' => $cambioMaestro, 'p_aAlumno' => $altaAlumno, 'p_bAlumno' => $bajaAlumno, 'p_cAlumno' => $cambioAlumno, 'p_aPeriodo' => $altaPeriodo, 'p_bPeriodo' => $bajaPeriodo, 'p_cPeriodo' => $cambioPeriodo, 'p_aGruposCursos' => $altaGrupoCursos, 'p_bGruposCursos' => $bajaGrupoCursos, 'p_cGruposCursos' => $cambioGrupoCursoselds, 'p_verReportes' => $verReportes), $id_permiso);
if (mysqli_affected_rows($conexion) > 0) {
$alertMsg = "Permiso actualizado satisfactoriamente";
} elseif (!$result) {
$alertMsg = "Algo salio mal: " . mysql_error();
} else {
$alertMsg = "No encontramos ningun Permiso con el id {$id_permiso} o no hubo cambios en la informacion";
}
echo "<script>\t\n\t\t\talert(\"{$alertMsg}\");\t\t\n\t\t\twindow.location.href = \"../../vistas/menus/menuABCAdmins.php\"\n\t\t\t</script>";