I have a php script as "save.php" which contains sql queries, and need to run this script in the background i.e., not in the browser. For calling this script I am using the exec() command in file named "trigger.php".
now when save.php is called by exec() it runs normal when the mysql queries are not used., but when I put the mysql queries the queries alone doesn't work and rest of the script executes fine. As far as I am thinking the mysql_connect is not able to run.
I cannot use cronjob because my need is different, I use need to trigger the script and it should be running continuously, but not in intervals.
So, is there a way where I can create a MySqL Server connection in the file which needs to be running in the background?