dimanche 1 novembre 2015

How to retrieve data in mysql table column?

In Mysql Table, I've a table name: mental_illness that there's two enum row inside as :

N and P

It means Negative and Positive

and here's my PHP code to retrieve data from that table:

  if ($history->getMentalIllness())
  {
    echo HTML::section(3, _("Mental Illness : "));
    echo HTML::para(nl2br($history->getMentalIllness()));
  }

Here's my question:

How to use if else in that above PHP code like this:

If Mental Illness is P, then show Positive text and If Mental Illness is N then show Negative text

Because this code just show P and N instead of Negative and Positive text.

Thank you

Aucun commentaire:

Enregistrer un commentaire