MySQLI Recordset Error
I created this query using the MySQLI Recordset:
<?php
$district_results_private = new WA_MySQLi_RS("district_results_private",$sdpc_i,0);
$district_results_private->setQuery("SELECT *, t1.districtID as thedistrict, t1.statusID as statusID_final, t1.agreement_typesID as agtype from ((SELECT *, data.softwareID as code1, data.districtID as code FROM data WHERE data.softwareID = ? and data.statusID != 5 and data.agreement_typesID != 8 and ((data.agreement_typesID =11 and data.statusID= '10') or (data.agreement_typesID != 11) or (data.agreement_typesID = 11 and data.statusID = '1') or (data.agreement_typesID = '50' and data.statusID= '6'))) t1 LEFT JOIN (Select * from districts where state= ?) t9 on (t1.code = t9.districtID) LEFT JOIN (SELECT *, addendums_data.addendumID as selected_addendum from addendums_data) t2 On (t1.dataID = t2.dataID) LEFT JOIN (SELECT * from addendums) t7 on (t2.addendumID = t7.addendumID) LEFT JOIN (SELECT district_data_elements.districtID, district_data_elements.softwareID as code2, GROUP_CONCAT(element_name SEPARATOR ', ') as data_list from district_data_elements LEFT JOIN data_elements on data_elements.data_elementID = district_data_elements.data_elementID WHERE district_data_elements.softwareID = ? group by district_data_elements.districtID) t3 On (t1.code = t3.districtID) LEFT JOIN (Select * from agreement_types) t4 on (t1.agreement_typesID = t4.agreement_typesID) LEFT JOIN (Select * from status) t5 on (t1.statusID = t5.statusID) LEFT JOIN (SELECT * from software) t6 on (t1.code1 = t6.softwareID) LEFT JOIN (Select * from software_contact) t8 on (t6.softwareID = t8.softwareID)) Where t9.state = ? GROUP by t1.dataID ORDER BY t9.district_name ASC");
$district_results_private->bindParam("i", "".$_GET['softwareID'] ."", "-1"); //colname
$district_results_private->bindParam("s", "".$_GET['state'] ."", "-1"); //colname2
$district_results_private->execute();
?>
When I try to test it, it alway says it can't find colname in the recordset. I plugged the same query into PHPMyadmin and it returns the recordset results correctly. Any ideas where I am going wrong?