Echo using if/else statements

#1

Hi guys. So after sql select query am displaying the contents in a table using
td-open “.$result[‘status’].” td-close

Now values in column ‘status’ are stored as interger (i.e, 0,1,2). How do i echo “pending” if status=0, approved if status=1, rejected if status=2 , using if/else statements.
Kindly help!

#2

I’d recommend creating a status table and joining that in so you could echo $result[‘statusText’] or similar.

2 Likes