Hi all
I'm learning how to integrate PHP/Ajax and have come across a stumbling block that I need help/advice on please.
I call a PHP script (via an Ajax function) which updates my database. Now at the end of my script, if I do the following:
if (mysql_affected_rows() == 1) {
echo "It Worked!";
}
The Ajax function will alert() the text 'It Worked!' no problem, but instead of echoing text here, I actually want to include another PHP file which outputs HTML which would ultimately become the response.Text for my ajax function and i can't get it to work.
I have tried putting the string 'It Worked!' into the myscript.php script in the example below and nothing is returned in the alert() - any ideas why?
if (mysql_affected_rows() == 1) {
include("myscript.php");
}
Thanks for reading