Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2014
    Thanked 0 Times in 0 Posts

    Doing a simple SQL query in php so i can run as a cron

    So what i thought would be easy, turns out i have no idea. I can post to a form and change data not a problem. I have never had to just run a query from a php file as soon as its loaded ( so i can set up this file to run as a cron job ).

    The MYSQL query i have is: update job_queue set status = replace(status, "running", "done")

    But i have no idea how to put that onto a php page to run as soon as the php file is executed.

    Any help would be greatly appreciated.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Your Monitor
    Thanked 526 Times in 513 Posts
    Blog Entries
    The same way you would a normal query in a html / php script but without any html or other output.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts