Welcome Guest, Not a member yet? Register   Sign In
[HELP] sql depends to another sql
#2

[eluser]InsiteFX[/eluser]
Load your model in the controllers constructor.
Code:
// controller
$data['querys'] = $this->model_name->ambil_data_users($id);
$this->load->view('view_name', $data);

// model
function ambil_data_users($id)
{
return $this->db->query("select * from transaksi_users where id_users = '$id'")->result();
}

// view
<?php foreach($querys as $row): ?>
    &lt;?php echo "<tr><td>$row->nama_barang</td></tr>"; ?&gt;
&lt;?php endforeach; ?&gt;


Messages In This Thread
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 08:13 PM
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 11:15 PM
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 11:27 PM
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 11:30 PM
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 11:34 PM
[HELP] sql depends to another sql - by El Forum - 07-15-2012, 11:48 PM
[HELP] sql depends to another sql - by El Forum - 07-16-2012, 12:51 AM
[HELP] sql depends to another sql - by El Forum - 07-16-2012, 05:09 AM
[HELP] sql depends to another sql - by El Forum - 07-16-2012, 05:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB