Currently, I am utilizing $.post to retrieve results from a database.
The syntax I am using is as follows:
$.post('addbundle_summary', {id:id}, function(resultsummary) {
alert(resultsummary[0]);
})
In CodeIgniter, within my model, I am returning the result in the following manner. It's important to note that my SQL query always returns a single result, so $stackid will always be a single number:
return $stackid;
My controller sends this data back to the function with:
$this->output->set_content_type('application/json')->set_output(json_encode($data));
By checking developer tools, you can observe the result from the function as depicted in the image below.
Despite the fact that the result is 23, my alert is displaying only 2. If the result were 573, it would alert 5.
How can I modify this to return the complete result number instead of just the first digit?