Jump to content

if query for table - no entries, no table


kaz
 Share

Recommended Posts

If I have a field, e.g. a combo field or similar: is it possible to do an if-query for the 'fields' in it? I have a table with two columns and a few rows. I can address the rows using an if query, the question now is how do I address the table (table, tbody)?
I hope I'm expressing it clearly. The if query is, create the table only if one of the fields has been entered:

if ($page->sales_details > 0) {
echo "<table class='uk-table-responsive sales-table'>
        <tbody>"; }
        if ($page->sales_details->designation) {
        echo "
            <tr>
                <td class='sales-left uk-table-shrink'>Designation</td>
                <td class='sales-right'>{$page->sales_details->designation}</td>
            </tr>"; }

> 0 unfortunately does not work 😉

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...