I am working on to create a comparison of college i almost completed It but now i want find the empty values and put a strike instead of empty column i know i can do this using if statements what i am seeking is there a better way other than using nested if else or multiple if
controller has a function to select value
public function test()
{
$insId = "INS20160738";
$course = "B.Tech Electronics & Communication Engineering";
$this->load->model('comparisonModel');
$resFirst = $this->comparisonModel->selFirst($insId,$course);
foreach ($resFirst as $key => $value) {
echo '<h6> name:</h6><p>'.$value['course_name'].'</p><h6>Duration:</h6>'.$value['duration'].'
<h6>eligiblity:</h6><p>'.$value['eligibility'].'</p><h6>recognition:</h6><p>'.$value['recognition'].'</p><h6>Affiliation:</h6>'.$value['affiliation'].'
<h6>Certification:</h6>'.$value['certificate'].'<h6>Category:</h6>'.$value['category'].'<h6>Type:</h6>'.$value['type'].'<h6>Category:</h6>'.$value['school_batch'].'';
}
}
model for the selecting is
public function selFirst($insId,$course)
{
$stmt='SELECT * FROM `institute-course` WHERE `institute-id`= '.$this->db->escape($insId).' AND `course_name`='.$this->db->escape($course);
$res=$this->db->query($stmt);
return $res->result_array();
}
i get result like this
name:
B.Tech Electronics & Communication Engineering
Duration:
eligiblity:
plus two
recognition:
Affiliation:
A P J Abdul Kalam Technological University
Certification:
B.Tech in Electronics & Communication Engineering
Category:
under graduate
Type:
college
Category:
what i searching is there a better way to get result like this
name:
B.Tech Electronics & Communication Engineering
Duration: this field is Empty or put a strike
eligiblity:
plus two
recognition:this field is empty
Affiliation:
A P J Abdul Kalam Technological University
Certification:
B.Tech in Electronics & Communication Engineering
Category:
under graduate
Type:This Is filed Is empty
college
Category: this field is empty
with out using multiple if else statements
thanks in advance