i want to convert id to string in my sql query result.
i want to response json with string id ...
i tried convert(id, char) and cast(id as char) in select but problem remains ...
example:
{
"status": 1,
"message": "Success",
"nexturl": "http://domain.dev/feed/298",
"data": [
{
"id": 123456789,
"userid": 12,
}
]
}
i want to get this result:
{
"status": 1,
"message": "Success",
"nexturl": "http://domain.dev/feed/298",
"data": [
{
"id": "123456789",
"userid": "12",
}
]
}
json_encode($an array or an object);to do it. Then it will be correct. Yours probably wont be most of the time. A few minutes now and again with the manual can save you hours of pain And here is the manual