Putting some SQL in a PHP document

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TVining
    New Member
    • Dec 2007
    • 26

    Putting some SQL in a PHP document

    I have a few SQL tasks that I run regularly, and right now I do it the long way (using phpMyAdmin).

    I want to put the SQL into a php page that I can tuck in a protected directory and run throughout the day.

    Once I know the BEST way to go about it, I can get it from there, but what is truly the BEST way to go about this?

    Tony
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by TVining
    I have a few SQL tasks that I run regularly, and right now I do it the long way (using phpMyAdmin).

    I want to put the SQL into a php page that I can tuck in a protected directory and run throughout the day.

    Once I know the BEST way to go about it, I can get it from there, but what is truly the BEST way to go about this?

    Tony
    if your running Linux/Unix, check out cron jobs.

    if windows, create a scheduled task!

    both very easy to do for a beginner.

    create a PHP file that executes your queries, run it manually and test it.

    then run it like an executable file in both OS's you type:

    php -q -f your/path/to/php/file.php

    have fun! let us know if any questions.

    Comment

    Working...