How to word query
I want to display records from a table to show only those with one of 3 values in one field. I'm enclosing the offending code.
$Cycle=$_GET['CycleYear'];
$SQL_rs1 = "SELECT * FROM RCL_selections WHERE RCL_selections.r_Cycle_Year = $Cycle ORDER BY RCL_selections.r_date ASC, RCL_selections.r_seq ASC";
$rs1 = $sainttim->query($SQL_rs1);
$error = $rs1->errorInfo();
if (isset($error[2])) die($error[2]);
$totalRows_rs1 = $rs1->rowCount();
$Cycle contains the desired value. But I get an error at line $error = because $rs1 is not an object, so obviously the query failed. I've tried substituting ? for $Cycle in the. SQL, but then cannot work out how to phrase the query action. I've tried every combination I can think of. Did a prepare, bound variables, used execute, etc. But I need to a return an array of records.
Any help will be appreciated.!
Thanks,
Gail
