Jump to content

Table row output help


johnnys

Recommended Posts

Hi,

 

I have a table row that outputs some info, works fine - however instead of it displaying a '1' i'd like it to display 'yes'. Or if the field is empty display a 'n/a'.

 

Is there anything I can add to my code below to get it working?

<tr>                                  
     <th>Is Processed?</th>
     <td>{$result['isProcessed']}</td>

 </tr>

Thanks in advance :)

 

J

Link to comment
https://forums.phpfreaks.com/topic/279153-table-row-output-help/
Share on other sites

That result, I suppose is coming for a database so you need to put the code in the while... loop before it gets echoed into the page :)

Also, it depends how you store it as well, 1 = true ...... y = y so you can modify my code to:

$result = $result['isProcessed'] || $result['isProcessed'] == "y" ? "yes" : "n/a";

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.