I\'m trying to send back multiple variables from a php file to ajax using json in an array. The code in the php file works perfectly and does everything with my database lik
It's easy to forget about an echo or a var_dump() that you may have been using in the past to test how your script is working.
In my own script I had a var_dump(), which I had forgotten about, that wasn't using JSON_encode-ed text and sent plain text to the browser. This broke the dataType:"json" requirement and caused the success function not to work.
Took me a while to find the problem as I had ctrl+f(ed) for echo only and forgot about the vagabond var_dump().
printf is probably another suspect.