本文整理匯總了PHP中DatabaseHandler::execute方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseHandler::execute方法的具體用法?PHP DatabaseHandler::execute怎麽用?PHP DatabaseHandler::execute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::execute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: jdate
?>
<h3 class="sub-header">لیست بلاگ ها</h3>
<table class="table table-striped table-hover table-bordered">
<tr>
<th>ردیف</th>
<th>نام</th>
<th>ایمیل</th>
<th>متن کامنت</th>
<th>تاریخ ثبت</th>
<th>شماره پست</th>
<th>فعال</th>
<th>عملیات</th>
</tr>
<?php
if (isset($_POST['edit'])) {
DatabaseHandler::execute("UPDATE `comments` SET `activate` = !`activate` WHERE `id` = '{$_POST['comment_id']}' ; ");
}
$comments = COMMENTS::comments_SelectAll();
$i = 1;
foreach ($comments as $comment) {
$comment["add_time"] = jdate("Y/m/d", $comment["add_time"]);
$checked = "";
if ($comment["activate"]) {
$comment["activate"] = "<span style='color:green'>فعال</span>";
$checked = "checked";
} else {
$comment["activate"] = "<span style='color:red'>غیر فعال</span>";
}
$blog = BLOGS::blogs_SelectRow($comment["blog_id"]);
echo "\n\t\t <tr>\n\t\t \t\t\t<td>{$i}</td>\n\t\t\t\t\t<td>{$comment['full_name']}</td>\n\t\t\t\t\t<td>{$comment['mail']}</td>\n\t\t\t\t\t<td>{$comment['text']}</td>\n\t\t\t\t\t<td>{$comment['add_time']}</td>\n\t\t\t\t\t<td>{$blog['title']}</td>\n\t\t\t\t\t<td>{$comment['activate']} <form method='post' id='form{$comment['id']}'><input type='hidden' name='comment_id' value='{$comment['id']}'><input onchange='\$(" . '"#form' . $comment["id"] . '"' . ").submit();' type='checkbox' name='edit' class='edit'></form></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='#'>پاسخ</a>\n\t\t\t\t\t</td>\t\n\t\t </tr>";
$i++;
示例2: jdate
?>
<h3 class="sub-header">لیست بلاگ ها</h3>
<table class="table table-striped table-hover table-bordered">
<tr>
<th>ردیف</th>
<th>شماره بلاگ</th>
<th width="20%">عنوان</th>
<th>عنوان انگلیسی</th>
<th>تاریخ ثبت</th>
<th>تعداد بازدید</th>
<th>فعال</th>
<th>عملیات</th>
</tr>
<?php
if (isset($_POST['edit'])) {
DatabaseHandler::execute("UPDATE `blogs` SET `activate` = !`activate` WHERE `id` = '{$_POST['blog_id']}' ; ");
}
$blogs = BLOGS::blogs_SelectAll();
$i = 1;
foreach ($blogs as $blog) {
$blog["add_time"] = jdate("Y/m/d", $blog["add_time"]);
$checked = "";
if ($blog["activate"]) {
$blog["activate"] = "<span style='color:green'>فعال</span>";
$checked = "checked";
} else {
$blog["activate"] = "<span style='color:red'>غیر فعال</span>";
}
echo "\n\t\t <tr>\n\t\t \t\t\t<td>{$i}</td>\n\t\t\t\t\t<td>{$blog['id']}</td>\n\t\t\t\t\t<td>{$blog['title']}</td>\n\t\t\t\t\t<td>{$blog['title_en']}</td>\n\t\t\t\t\t<td>{$blog['add_time']}</td>\n\t\t\t\t\t<td>{$blog['hit_count']}</td>\n\t\t\t\t\t<td>{$blog['activate']} <form method='post' id='form{$blog['id']}'><input type='hidden' name='blog_id' value='{$blog['id']}'><input onchange='\$(" . '"#form' . $blog["id"] . '"' . ").submit();' type='checkbox' name='edit' class='edit'></form></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='?page=blog_insert&id={$blog['id']}'>ویرایش</a>\n\t\t\t\t\t</td>\t\n\t\t </tr>";
$i++;
}