I am writing an application in CodeIgniter where I specify the
meta-tag on every page in every controller which I have managed to send to my header te
Try this
In Model
function get_card($card)
{
$query = $this->db->query("SELECT * FROM table_name WHERE creditcards = '$card' ");
$result = $query->result_array();
$count = count($result); # New
if(empty($count)){ # New
return FALSE;
}
elseif($count > 1){ # New
return 0;
}
else{
return $result;
}
}
In Controller
public function show($card)
{
$result = $this->Listing_model->get_card($card); # Changed
if($result == FALSE){ # New
echo "No Data Found";
}
elseif($result == 0){ # New
echo "Multiple Data Found";
}
else{
$data["page_title"] = $result[0]['field_name']; # Changed
$this->load->view('includes/header',$data); # Changed
$this->load->view('listings/listing_card',$data);
$this->load->view('includes/footer');
}
}
In View
# Changed