The Ternary operator is not identical to an if-then. You should have written it
echo ($DAO->get_num_rows() == 1) ? "is" : "are";
It returns the value in the 2nd or 3rd position. It does NOT execute the statement in the 2nd or 3rd position.
More Related Contents:
- Stacking Multiple Ternary Operators in PHP
- How to write a PHP ternary operator [duplicate]
- Ternary operator and string concatenation quirk?
- What is ?: in PHP 5.3? [duplicate]
- Ternary operator left associativity [duplicate]
- How to concatenate multiple ternary operator in PHP? [duplicate]
- What does ? … : … do? [duplicate]
- Understanding nested PHP ternary operator [duplicate]
- PHP syntax question: What does the question mark and colon mean? [duplicate]
- C#’s null coalescing operator (??) in PHP
- PHP multiple ternary operator not working as expected
- Which coding style you use for ternary operator? [closed]
- Where can I read about conditionals done with “?” and “:” (colon)? [duplicate]
- Reference — What does this symbol mean in PHP?
- Nginx serves .php files as downloads, instead of executing them
- Fixing broken UTF-8 encoding
- Global or Singleton for database connection?
- Checking if form has been submitted – PHP
- Send array with Ajax to PHP script
- Listing all the folders subfolders and files in a directory using php
- Call to a member function execute() on boolean in [duplicate]
- Generate SEO friendly URLs (slugs) [closed]
- Developing a tracking pixel
- convert month from name to number
- PHP syntax for dereferencing function result
- Any way to keep curl’s cookies in memory and not on disk
- Check for duplicates before inserting
- FTP upload file to distant server with CURL and PHP uploads a blank file
- Programmatically access currency exchange rates [closed]
- Read JSON Data Using PHP [duplicate]