Active records for beginners...

#1
[eluser]thesocialhacker[/eluser]
Hello all,


Sorry to bother the forums, but I'm having a bit of a tricky time with the active record and "Objects" it returns... Currently i'd like to retrieve a single records, so i
Code:
function getmy ($id) {
         $q = $this->db->get_where('socialhubspot', array('company_id' => $id));
         if ($q->num_rows() > 0) {
             $data=$q->row(0);
             return $data;
         }

in my controller i
Code:
$data['row']=$this->backend->getmy($my_id);
      $this->load->view('frontend',$data);

and in my view i
Code:
<?php  $mydata = $row[0]; ?>

My god, i just know that can't be a proper way to go about this...


Messages In This Thread
Active records for beginners... - by El Forum - 09-01-2010, 05:36 AM
Active records for beginners... - by El Forum - 09-01-2010, 06:20 AM
Active records for beginners... - by El Forum - 09-01-2010, 07:37 AM
Active records for beginners... - by El Forum - 09-01-2010, 07:43 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.