Jump to content

Table row output help


johnnys
Go to solution Solved by Barand,

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
Share on other sites

I moved the 

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

 code you supplied to another part of the page and now it says 'y' in every field column, apart from the isProcessed filed where it says 'yes'

Edited by johnnys
Link to comment
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";
Link to comment
Share on other sites

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.