function reportFix($what, $aff = -1) { global $fixtime; if ($aff = -1) { $aff = affectedRows(); } echo $what, " ", format(__("{0} rows affected."), $aff), " time: ", sprintf('%1.3f', usectime() - $fixtime), "<br />"; }
function query($query) { global $db, $dbDebug; $db_start = microtime(true); $result = mysqli_query($db, $query); $db_end = microtime(true); $db_time = round(($db_end - $db_start) * 1000, 6); $dbDebug['total'] = $dbDebug['total'] + $db_time; array_push($dbDebug['log'], $query); array_push($dbDebug['time'], $db_time); array_push($dbDebug['rows'], affectedRows()); return $result; }
<?php // $Id: sendPass.php 23863 2015-09-14 00:27:14Z 1070356 $ require_once 'functions.php'; if (isset($_POST['id'])) { $id = $_POST['id']; $result = sql("SELECT mail, name FROM users WHERE id={$id}"); if ($result->num_rows) { $row = $result->fetch_row(); $pass = sendPass($row[0], $row[1]); // 비밀번호를 만들어 메일로 보낸다 if ($pass) { $pass = escapeString(getHash($pass)); sql("UPDATE users SET pass='******' WHERE id = {$id}"); echo affectedRows(); // 반환 값이 1이면 정상이다 } } $result->close(); }