Jump to content

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


capella07

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.