I found the problem.
In the following query, there are two ID fields. One in the PORC_records table and one in the PORC_classes table.
<?php
$rsRecordView = new WA_MySQLi_RS("rsRecordView",$siteguide2018,1);
$rsRecordView->setQuery("SELECT * FROM PORC_records
LEFT OUTER JOIN aou_list ON PORC_records.species_number = aou_list.SPNO
LEFT OUTER JOIN PORC_classes ON PORC_records.PORC_class = PORC_classes.PORC_class
WHERE PORC_records.record_number = ?
");
$rsRecordView->bindParam("s", "".(isset($_GET['record_number'])?$_GET['record_number']:"") ."", "-1"); //colname
$rsRecordView->execute();
?>
So I changed the name of the PORC_classes.ID field to IDN and that fixed the problem.