You have this on line 118:
$ConditionalQuery->bindColumn("OrderType", "d", "K", "WA_DEFAULT");
That means that you have the data type set to numeric, but have set the value to "K"... that is incompatible and will cause a syntax error.
What is the data type of the OrderType column in your database? That row should probably either be:
$ConditionalQuery->bindColumn("OrderType", "s", "K", "WA_DEFAULT");
or:
$ConditionalQuery->bindColumn("OrderType", "d", "1", "WA_DEFAULT");