Normally this happens when there is a mismatch between your variables or the result you are returning. Make sure the variables and the result being returned are the same with the query 100%.