1

I was trying to retrieve a data result provided by the SQL below

SELECT to_char(generate_series('2016-10-04', '2016-12-31', interval '1 mon'), 'YYYY-MM') AS month

If we can run the said query above, it will return a result of:

month(text)
"2016-10"
"2016-11"
"2016-12"

but in my php code, it does not return any result or values are null

$qr = "SELECT to_char(generate_series('2016-10-04', '2016-12-31', interval '1 mon'), 'YYYY-MM') AS month";
$rs = $this->conn->fetchAll($qr);

print_r($rs);

result:

Array
(
)

other sql queries in my php code works but this one is not, am i missing something here? i need a shade on this T_T

1
  • I see you are using $this->conn, what is your underlying RDBMS API ? Commented Oct 4, 2016 at 10:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.