本文整理匯總了PHP中Update::runQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP Update::runQuery方法的具體用法?PHP Update::runQuery怎麽用?PHP Update::runQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Update
的用法示例。
在下文中一共展示了Update::runQuery方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: USER
require_once 'classes/class.user.php';
$user_home = new USER();
if (!$user_home->is_logged_in()) {
$user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
require_once 'classes/class.update.php';
$update = new Update();
$scode = trim($_POST['supcode']);
$units = trim($_POST['units']);
$appkgs = trim($_POST['appkgs']);
$supkgs = trim($_POST['supkgs']);
$editor = $row['id'];
$stmt = $update->runQuery("SELECT * FROM today_supply WHERE supplier_code=:sup_code");
$stmt->execute(array(":sup_code" => $scode));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() > 0) {
$msg = '<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4> <i class="icon fa fa-warning"></i> Sorry!</h4>
Supply record Already added.
</div>';
// $msg = "
// <div class='alert alert-error'>
// <button class='close' data-dismiss='alert'>×</button>
// <strong>Sorry !</strong> email allready exists , Please Try another one
// </div>
// ";
} else {