我无法在 CodeIgniter 的 table 中正确列出
I can't list properly in table in CodeIgniter
查看时全部列在第一列。即使我将它与它分开也不会添加到第二列或第三列。它继续到第一列的底部。
enter image description here
控制器代码
$data['post_verbs'] = $this->verb_model->get_verbs($post->id);
模型代码
public function get_verbs($id)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id)));
return $query->result();
}
查看代码
<tbody>
<?php foreach ($post_verbs as $verbs => $code):?>
<tr>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 1) { ?>
<td> <?php echo $code->title; ?> </td> <?php } ?>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 2) { ?>
<td> <?php echo $code->title; ?></td> <?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
控制器
$data['post_1'] = $this->fiil_model->get_verbs($post->id, 2, 1);
$data['post_2'] = $this->fiil_model->get_verbs($post->id, 2, 2);
$data['post_3'] = $this->fiil_model->get_verbs($post->id, 2, 3);
$data['post_4'] = $this->fiil_model->get_verbs($post->id, 2, 4);
型号
public function get_verbs($id, $altZamanId, $durumTurId)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id), clean_number($altZamanId), clean_number($durumTurId)));
return $query->result();
}
查看
<tbody>
<?php foreach ($post_1 as $verbs => $code):?>
<tr>
<td><?php echo $code->title; ?></td>
<td><?php echo $post_2[$verbs]->title; ?></td>
<td><?php echo $post_3[$verbs]->title; ?></td>
<td><?php echo $post_4[$verbs]->title; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
查看时全部列在第一列。即使我将它与它分开也不会添加到第二列或第三列。它继续到第一列的底部。
enter image description here
控制器代码
$data['post_verbs'] = $this->verb_model->get_verbs($post->id);
模型代码
public function get_verbs($id)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id)));
return $query->result();
}
查看代码
<tbody>
<?php foreach ($post_verbs as $verbs => $code):?>
<tr>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 1) { ?>
<td> <?php echo $code->title; ?> </td> <?php } ?>
<?php if ($code->altZamanId == 2 AND $code->durumTurId == 2) { ?>
<td> <?php echo $code->title; ?></td> <?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
控制器
$data['post_1'] = $this->fiil_model->get_verbs($post->id, 2, 1);
$data['post_2'] = $this->fiil_model->get_verbs($post->id, 2, 2);
$data['post_3'] = $this->fiil_model->get_verbs($post->id, 2, 3);
$data['post_4'] = $this->fiil_model->get_verbs($post->id, 2, 4);
型号
public function get_verbs($id, $altZamanId, $durumTurId)
{
$sql = "SELECT fiilcekimleri.*, fiiller.title AS fiil_title, fiiller.title_slug AS title_slug
FROM fiilcekimleri LEFT JOIN fiiller ON fiiller.id = fiilcekimleri.fiil_id
WHERE fiilcekimleri.fiil_id = ? AND fiilcekimleri.altZamanId = ? AND fiilcekimleri.durumTurId = ? ORDER BY fiilcekimleri.ozneTurId ASC";
$query = $this->db->query($sql, array(clean_number($id), clean_number($altZamanId), clean_number($durumTurId)));
return $query->result();
}
查看
<tbody>
<?php foreach ($post_1 as $verbs => $code):?>
<tr>
<td><?php echo $code->title; ?></td>
<td><?php echo $post_2[$verbs]->title; ?></td>
<td><?php echo $post_3[$verbs]->title; ?></td>
<td><?php echo $post_4[$verbs]->title; ?></td>
</tr>
<?php endforeach; ?>
</tbody>