本文整理汇总了PHP中sql::rows方法的典型用法代码示例。如果您正苦于以下问题:PHP sql::rows方法的具体用法?PHP sql::rows怎么用?PHP sql::rows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sql
的用法示例。
在下文中一共展示了sql::rows方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_nav_menu
public static function get_nav_menu()
{
$rows = sql::rows('parent_category', "status=1 and parent_id=0");
$links = '';
foreach ($rows as $row) {
$links .= '<li><a href="' . site_url('home/get_tutorial/') . '/' . $row['id'] . '">' . $row['category'] . '</a></li>';
}
return $links;
}
示例2:
?>
</font></td>
</tr>
<tr>
<th>Question ?</th>
<td><textarea name="question" rows="5" cols="40" class="text required ui-widget-content ui-corner-all"><?php
echo $question;
?>
</textarea></td>
</tr>
<tr>
<th>Answers <span class='required'><font color="red">*</font></span></th>
<td>
<?php
$ans = sql::rows('model_test_answer', "questions_id={$questions_id} order by answer_id");
?>
<span class='block margin_2_0'><font color="black">A:</font> <input type='text' name='answer[]' value='<?php
echo $ans[0]['answer'];
?>
' class='text required ui-widget-content ui-corner-all' /> <input type="radio" name="is_correct" <?php
if ($ans[0]['is_correct'] == 1) {
echo 'checked';
}
?>
value='1' /><font color="black"> Is Correct</font></span>
<span class='block margin_2_0'><font color="black">B:</font> <input type='text' name='answer[]' value='<?php
echo $ans[1]['answer'];
?>
' class='text required ui-widget-content ui-corner-all' /> <input type="radio" name="is_correct" <?php
if ($ans[1]['is_correct'] == 1) {
示例3:
<h2>My Application</h2>
<div class="subfieldsset3">
<div style="height: 500px; width: 530px; overflow-x: hidden; overflow-y: scroll; border: 1px solid #ccc; margin-top: 5px;">
<table style="border: 1px solid #B7CAF6;" width="100%">
<tr style="background-color: #7F7C7C">
<td style="border: 1px solid #B7CAF6;">Category Name</td>
<td style="border: 1px solid #B7CAF6;">Company Name</td>
<td style="border: 1px solid #B7CAF6;">Apply</td>
<td style="border: 1px solid #B7CAF6;">Detail</td>
</tr>
<?php
$apps=sql::rows('application',"user_id=$uid ORDER BY id DESC");
for($i=0;$i<count($apps);$i++)
{
?>
<tr>
<td style="border: 1px solid #B7CAF6;"><?=$this->user_model->get_my_category($apps[$i]['cat_id']);?></td>
<td style="border: 1px solid #B7CAF6;"><?=$this->user_model->get_company_name($apps[$i]['add_id']);?></td>
<td style="border: 1px solid #B7CAF6;"><?=$apps[$i]['apply_date']?></td>
<td style="border: 1px solid #B7CAF6;">
<a href="<?=site_url().'user/my_job_detail/'.$qu[$i]['add_id'];?>">Detail</a>
</td>
</tr>
<?}?>
</table>
</div>
</div>
示例4:
</font> </td>
</tr>
<tr>
<th>Question ?</th>
<td><textarea name="question" rows="5" cols="40" class="text required ui-widget-content ui-corner-all"><?php
echo $question;
?>
</textarea></td>
</tr>
<tr>
<th>Answers <span class='required'><font color="red">*</font></span></th>
<td>
<?php
$ans = sql::rows('bcs_mcq_answer', "questions_id={$questions_id} order by answer_id");
?>
<span class='block margin_2_0'><font color="black">A:</font> <input type='text' name='answer[]' value='<?php
echo $ans[0]['answer'];
?>
' class='text required ui-widget-content ui-corner-all' /> <input type="radio" name="is_correct" <?php
if ($ans[0]['is_correct'] == 1) {
echo 'checked';
}
?>
value='1' /><font color="black"> Is Correct</font></span>
<span class='block margin_2_0'><font color="black">B:</font> <input type='text' name='answer[]' value='<?php
echo $ans[1]['answer'];
?>
' class='text required ui-widget-content ui-corner-all' /> <input type="radio" name="is_correct" <?php
if ($ans[1]['is_correct'] == 1) {
示例5: get_category_options
function get_category_options($sel = '')
{
$rows = sql::rows('category', "status=1");
$opt .= '<option value="">Select</option>';
foreach ($rows as $row) {
if ($row['category_id'] == $sel) {
$opt .= '<option value="' . $row['cat_id'] . '" selected="selected">' . $row['category_name'] . '</option>';
} else {
$opt .= '<option value="' . $row['cat_id'] . '">' . $row['category_name'] . '</option>';
}
}
return $opt;
}
示例6:
<div id="content">
<h2>Inbox</h2>
<div class="subfieldsset">
<div style="height: auto; width: auto; overflow-x: hidden; overflow-y: scroll; border: 1px solid #ccc; margin-top: 5px;">
<table style="border: 1px solid #B7CAF6;">
<tr style="border: 1px solid #B7CAF6;">
<th style="border: 1px solid #B7CAF6;">Sender</th>
<th style="border: 1px solid #B7CAF6;">Title</th>
<th style="border: 1px solid #B7CAF6;">Body</th>
<th style="border: 1px solid #B7CAF6;">Date</th>
<th style="border: 1px solid #B7CAF6;">Reply</th>
<tr>
<?php
$apps = sql::rows('publisher_inbox', "publisher_id= '{$uid}' ORDER BY id DESC");
for ($i = 0; $i < count($apps); $i++) {
?>
<tr style="border: 1px solid #B7CAF6;">
<td align="left" style="border: 1px solid #B7CAF6;" bgcolor="#e9ece9" class="table_value">
<a href="<?php
echo site_url() . 'publisher/view_sender/' . $apps[$i]['user_id'];
?>
"> <?php
echo $this->publish_model->get_sender($apps[$i]['user_id']);
?>
</a>
</td>
<td align="left" style="border: 1px solid #B7CAF6;" bgcolor="#e9ece9" class="table_value">
<?php
echo $apps[$i]['job_title'];
?>
</td>