@lajosbencz
HI There, In my database there is some data is in special charactor with latin1 charset.so when i use toArray(), it will produce nothing. But when i remove that special charctor then it will product output as expected.so there must be charset issues with toArray() function.
When i convert my data into utf-8 charset it will produce output as expected. There is no error in my coding ;)
@Graphmatic, I did everything from checking to db log files. but i got the result while converting it to utf-8 charset. in my database there is so many special charactors.