How do I get a 0 count on SQLSelect call
If I do a SQLSelect call let’s say:
$sqlQuery = SQLSelect::create()
->setFrom("Soup_Live")
->selectField('ID', 'ID')
->addWhere("Soup = ‘Tomato'");
$Soups = $sqlQuery->execute();
If(count($Soups)>1){
Echo “I like soup”
}
Now this works fine if there are records returned but if there are no records the count comes still back with 1 as the object returned is not empty it returns
“MySQLQuery::__set_state(array( 'handle' => mysqli_result::__set_state(array( 'current_field' => NULL, 'field_count' => NULL, 'lengths' => NULL, 'num_rows' => NULL, 'type' => NULL, )), 'currentRecord' => NULL, 'rowNum' => -1, 'queryHasBegun' => false, ))”
Is there any way to get a 0 count?