Return value from query statement - jQuery
I have a ajax, jquery form which works fine, but returning a message from <div></div>
. I want to return a value from a db query, a single value.
How do I go about doing it.
开发者_如何学PythonThanks Dave
As far as I know you can return your result in any form you want. I used to return my result as formatted html and then used that as the innerHTML for a div. It all depends on how you process your result I guess.
For your situation, just return your result as an ordinary string (e.g. echo $result in your php backend code). Then you could cast/convert the value to whatever form you want in your javascript/jquery frontend.
I hope I understood your question right
精彩评论