LEFT OUTER JOIN
I am trying to display all of the records from aou_list (with a limiting WHERE clause) and the matching records from CountyBirdListsNew (but with a limiting WHERE clause).
Here is the code I tried.
<?php
$rsRecordView = new WA_MySQLi_RS("rsRecordView",$siteguide2018,0);
$rsRecordView->setQuery("SELECT CountyBirdListsNew.Status, aou_list.CommonName FROM aou_list LEFT OUTER JOIN CountyBirdListsNew ON aou_list.SPNO = CountyBirdListsNew.SPID WHERE CountyBirdListsNew.CountyNumber = ? AND aou_list.PA = True AND aou_list.FullSpecies = True ORDER BY aou_list.AOU_Order");
$rsRecordView->bindParam("i", "".((isset($_POST["CountySelect"]))?$_POST["CountySelect"]:"") ."", "-1"); //colname
$rsRecordView->execute();
?>
I am not getting all of the aou_list records. I assume it is because of the WHERE clause on CountyBirdListsNew.
It lists the records for the WHERE clause on CountyBirdListsNew, but not blank records.
The relevant fields are aou_list.SPNO, aou_list.CommonName, aou_list.PA, aou_list.FullSpecies, CountyBirdListsNew.SPID, CountyBirdListsNew.Status, CountyBirdListsNew.CountyNumber
Can someone give me a solution to this problem?