[eluser]PODz_EN_Co.[/eluser]
Hello, i've come again of the same error:
Quote:A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND createstatus = 'ACTIVE'' at line 1
SELECT usertypeid, usertypedesc FROM usertype WHERE parentusertypeid >= ? AND createstatus = 'ACTIVE'
Code:
function listUserTypes($parentUserTypeId=0){
$SQL = "SELECT usertypeid, usertypedesc FROM usertype ";
if($parentUserTypeId == 0){
$SQL .= " WHERE parentusertypeid >= ? ";
} else {
$SQL .= " WHERE parentusertypeid > ? ";
}
$SQL .= " AND createstatus = 'ACTIVE'";
$this->result = $this->db->query($SQL, $parentUserTypeId);
return $this->result;
}
Making the 2nd argument to array($parentUserTypeId) returns false data. I know this should be correct but why is the error prompting?
By the way, I'm passing this call:
Code:
$parentUserTypeId = 3;
$this->membership->listUserTypes($parentUserTypeId);
Thanks in advance.