I'm calling a PHP page that runs a SQL query using AJAX on a main PHP page.
I want to pass the number of results from that SQL query back to the calling PHP page.
Any suggestions?
CodePudding user response:
Can you please describe it more extensively? I dont understand what is your main PHP page?
In general your php page running the SQL querry needs to get the number of results and just output them, the client performing the AJAX then will get the number as a response.
Better: Return the number withing a json, like {"success":true, "number":42}
CodePudding user response:
I can think of about ten thousand already-existing web pages which will show you exactly how to do that in AJAX – in every programming language ever devised.
I'm not trying to be rude, but – obviously, you have not yet looked around. At all.