SQL query problem
The following query is not working. When I try to test it in Dreamweaver, it tells me I have an error in the line starting with "AND (PORC_Votes.batch_date = ? OR PORC_Votes.batch_date2 = ?)"
Are the JOINS stated properly? Is the line above okay? It looks okay to me.
<?php
$rsBatchRecords = new WA_MySQLi_RS("rsBatchRecords",$siteguide2018,0);
$rsBatchRecords->setQuery("SELECT PORC_records.record_number, PORC_records.sendto_second_round, PORC_records.species_number, PORC_Votes_record_number, PORC_Votes.round1_class, PORC_Votes.round2_class, PORC_Votes.member_name, PORC_Votes.batch_date, PORC_Votes.batch_date2, aou_list.SPNO, aou_list.CommonName
FROM (((PORC_Votes
INNER JOIN PORC_records ON PORC_records.record_number = PORC_Votes.record_number)
INNER JOIN aou_list ON aou_list.SPNO = PORC_records.species_number)
AND (PORC_Votes.batch_date = ? OR PORC_Votes.batch_date2 = ?)
ORDER BY PORC_Votes.record_number");
$rsBatchRecords->bindParam("t", "".(isset($_GET['batch_date'])?$_GET['batch_date']:"") ."", "-1"); //colname
$rsBatchRecords->execute();
?>