Jump to content

Recommended Posts

Posted

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 😉

Posted (edited)

Maybe just check if the field is empty.

$page->sales_details ==""
or
$page->sales_details ==''
Edited by breezer
  • Like 2

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
  • Recently Browsing   0 members

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