本文整理汇总了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++;
}