本文整理匯總了PHP中Requirements::find_by_sql方法的典型用法代碼示例。如果您正苦於以下問題:PHP Requirements::find_by_sql方法的具體用法?PHP Requirements::find_by_sql怎麽用?PHP Requirements::find_by_sql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Requirements
的用法示例。
在下文中一共展示了Requirements::find_by_sql方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: customEncrypt
<?php
require_once "inc/initialize.php";
?>
<?php
$sql = "SELECT * FROM requirements ORDER BY `id` DESC ";
$require_contents = Requirements::find_by_sql($sql);
?>
<ul>
<?php
foreach ($require_contents as $require_content) {
?>
<li>
<a href='programs_details.php?id=<?php
echo customEncrypt($require_content->id);
?>
'>
<i class="icon-hand-right"></i> <?php
echo htmlentities($require_content->name);
?>
</a>
</li>
<?php
}
?>
</ul>
示例2: include_layout_template
<br>
<br>
<!-- Content -->
<div class="row-fluid">
<?php
include_layout_template('admin_menu.php');
?>
<div class="span9">
<h2>Program Requirements</h2>
<hr>
<?php
$query = "SELECT * FROM Requirements ORDER BY id DESC";
$result = Requirements::find_by_sql($query);
$pagecounter = 1;
$serialno = 1;
$max = 10;
$number_of_requirements = sizeof($result);
echo '<div class="tabbable">
<div class="tab-content">';
foreach ($result as $row) {
if ($serialno % $max == 1) {
if ($pagecounter == 1) {
echo '<div class="tab-pane active" id="' . $pagecounter . '">';
} else {
echo '<div class="tab-pane" id="' . $pagecounter . '">';
}
echo '<table class="table table-hover">
<thead>
示例3:
?>
Date: <i class="icon-calendar"></i> <?php
echo $item->created_time;
?>
</div>
<hr>
</p>
<?php
}
?>
<h3><i class="icon-certificate"></i> Admission Requirements</h3>
<ul>
<?php
$query1 = "SELECT * FROM requirements\r\n WHERE visible = 1\r\n AND name !='' \r\n ORDER BY id DESC \r\n Limit 3";
$requirements = Requirements::find_by_sql($query1);
foreach ($requirements as $prog) {
if ($prog->name != '') {
?>
<li>
<a href='#?id=<?php
echo $prog->id;
?>
'><?php
echo $prog->name;
?>
</a>
</li>
<?php