Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    16
    Thanks
    3
    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
    Location
    Your Monitor
    Posts
    4,327
    Thanks
    60
    Thanked 525 Times in 512 Posts
    Blog Entries
    4
    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
    •