I am tring to write a php file which runs some queries in hope of linking it to a scheduled job. And for this after I create the php file, I test it by running it in the browser and it wotks well But on running it from command prompt which I feel is ideally how they will be run in scheduled tasks or cron jobs.
I once tried to create a similar php file while i was using mysql and it kepts on generating errors when run in command prompt so in the end I had to do my own database connection using mysqli and got it to do the job. But no that am using postgresql I would like to avoid going into manual db connection So I want to use either ew_Execute functions or DbHelper and make it work when run in command prompt as well.
Has anyone ever created a custom files and used either ew_Executes or DBHeper fucntions and it still runs well when called from command prompt, are here thing I should look out for when creating it for command prompt. Whats the right way to go about this etc etc.
Thing ive tried:
NOTE:All these still run my queries in the browser BUT wont run successfully when called from command prompt
-creating a custom file with common files ticked and header and footer and then use ew_ExecuteHtml("some query")
-creating a custom file with common files ticked and header and footer and then use DBhelp->ExecuteHtml("somequery");
-creating a custom file with common files ticked and NO header and footer and then use ew_ExecuteHtml("some query").
-creating a custom file with common files ticked and NO header and footer and then use DBhelp->ExecuteHtml("somequery");
--creating a custom file WITHOUT common files ticked and include dbehlper.php required files only manually and then use DBhelp->ExecuteHtml("somequery");.
NOTE:I know I can achive this if I manually make the db connection but it looses the purpose since I already have dbhelper I would want to use that instead, so any help in highly appreaciated