[eluser]Aimadj[/eluser]
[quote author="Rey Philip Regis" date="1233116715"]I dont understand the question? Can you elaborate more?[/quote]
ok sorry because i'm new with this framwork . view this :
i'am create this file videos.php in controllers floder with this code :
Code:
<?php
class Videos extends Controller
{
function videos() {
parent::Controller();
$this->load->database();
$this->load->helper('url');
}
function index() {
$data['query']=$this->db->get('videos');
$data['page_title']='Videos Pages Selection';
$data['cat_title']='tst cat name';
$this->load->view('views_videos' , $data);
}
function details($id)
{
$data['query']=$this->db->where('id',$id);
$data['query']=$this->db->get('videos');
$this->load->view('detailview', $data);
}
}
?>
and i'm create this file views_videos.php in views floder :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $page_title; ?></title>
</head>
<body>
<h1>Videos List :</h1>
<table border="1">
<tr>
<td>Photo</td>
<td>Title</td>
<td>desception video</td>
<td>Category</td>
<td>add time</td>
</tr>
<?php foreach ($query->result() as $row){ ?>
<tr>
<td><img >photo?>" alt="<?=$row->title?>" /></td>
<td><?=anchor('videos/details/'.$row->id, ''.$row->title);?></td>
<td><?=$row->desc?></td>
<td> HERE I NEED INSERT THE CATEGORY NAME </td>
<td> </td>
</tr>
<?php } ?>
</table>
<p><br />Page rendered in {elapsed_time} seconds</p>
</body>
</html>
and in database i have this 2 table :
Code:
1-Videos
---id
---title
---de
---photo
---catid
2-cats
---id
---catname
will now i'am need to insert in this
<td> HERE I NEED INSERT THE CATEGORY NAME </td> the category where video locate . and i'am insert in videos table catid field it's field is the id of this video category .
if you don't understand i'am send you example in page to view tks for your replay
and i'am sorry for my bad english :red: