function fullJoinTest()
{
$con = ModelBase::getConnection();
$sql = "SELECT airline, airport
FROM airlines
LEFT JOIN airports on airlines.icao_code = airports.icao_code";
$query = $con->prepare($sql) or die("Error preparing sql in Search (test) ");
$query->execute() or die("Error executing query in Search (test) ");
error_log($query->num_rows);
}
Now it keeps returning 0
for the number of rows it's returning. When I plug that same query into phpMyAdmin it returns the expected result set.
Does MySQLi play nice with JOINs? Is there another way to go around this? Eventually it will have a lot more joins and some WHERE
clauses. I would like to keep using prepared statements.