0

i have an apps with codeigniter as framework and ignited datatables as table libraries and also serverside. i would like to generate the table, and i put the code in the codeigniter controller, example :

$this->datatables->select('name,address,gender')
->from('person');

echo $this->datatables->generate();

in the database table, the value of gender column just integer, with 1 and 2 as value, i mean 1 as male, and 2 as female. how to setting if the value detect 1 the view is male and if 2 the view is female in the table ?

1 Answer 1

1
$person = $this->datatables->select('name,address,gender')
->from('person');
if($person->gender == 1)
{
// do what happens when male
}
else if($person->gender == 2)
{
// do what happens when female
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.