• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Errors

#9
[eluser]Sumon[/eluser]
please change the model as
Code:
function getMainFeature(){
$data = array();
$this->db->select("id,name,shortdesc,image");
$this->db->where('featured', 'true');
$this->db->where('status', 'active');
$this->db->orderby("rand()");
$this->db->limit(1);
$Q = $this->db->get('products');
if ($Q->num_rows() > 0 ){
foreach ($Q->result_array() as $row){
    $data[] = array(
    "id" => $row['id'],
    "name" => $row['name'],
    "shortdesc" => $row['shortdesc'],
    "image" => $row['image']
    );
     }
}
$Q->free_result();
return $data;
}// end getMainFeature
$data[] instead of $data


Messages In This Thread
Errors - by El Forum - 09-19-2008, 08:41 AM
Errors - by El Forum - 09-19-2008, 08:49 AM
Errors - by El Forum - 09-19-2008, 08:52 AM
Errors - by El Forum - 09-19-2008, 09:47 AM
Errors - by El Forum - 09-19-2008, 10:11 AM
Errors - by El Forum - 09-19-2008, 10:12 AM
Errors - by El Forum - 09-19-2008, 01:15 PM
Errors - by El Forum - 09-19-2008, 01:48 PM
Errors - by El Forum - 09-19-2008, 03:55 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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