kaz Posted Monday at 03:10 PM Share Posted Monday at 03:10 PM 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 More sharing options...
breezer Posted 21 hours ago Share Posted 21 hours ago Maybe just check if the field is empty. $page->sales_details !="" or $page->sales_details !='' 2 Link to comment Share on other sites More sharing options...
kaz Posted 14 hours ago Author Share Posted 14 hours ago $page->sales_details =='' works fine, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now