Jump to content

How do I change boolean output from query to text value in table


Recommended Posts

I have a query in a PHP/MySQL Web application that is returning (among other things), into a dynamically-built HTML table, the boolean column "IsOnTime" as a 1 or 0.

 

The HTML table is being built like this:

echo '<table>'
        while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
	echo '<tr>
		<td align="left">' . $row['IsOnTime'] . '</td>
	</tr>';
}
// Close the table
echo '</table>';

I would like to display the boolean fields as a "Yes" or "No".

 

How can I do that?

 

(I actually have four boolean fields I'll need to do that to...)

 

Thanks for anyone's help!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.