We are uploading php files to webserver. Can i do cron work in web server??

Discussion in 'PHP' started by sankarsubramanian, Dec 28, 2006.

  1. #1
    We are uploading php files to webserver.
    Can i do cron job in web server??
    if so, how?
     
    sankarsubramanian, Dec 28, 2006 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    explain the question a little better please .....
     
    krakjoe, Dec 28, 2006 IP
  3. sankarsubramanian

    sankarsubramanian Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i want to delete some records daily from the DB. to do this i am going to use cron.
    i upload files to server via net to the webserver.
    here how can i use cron to do the deletion???
    can u please explain??

    are u understand now??
     
    sankarsubramanian, Dec 28, 2006 IP
  4. sankarsubramanian

    sankarsubramanian Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i want to delete some records daily from the DB. to do this i am going to use cron.
    i upload php files to server via net to the webserver.
    here how can i use cron to do the deletion???
    can u please explain??

    are u understand now??
     
    sankarsubramanian, Dec 28, 2006 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Well firstly work out the sql for deteting the records, and save a php file similar to :

    <?
    include("db.php"); // assuming you have a database connection ...
    mysql_query("DELETE from `table` WHERE id < '$whatever'");
    ?>

    then use cron to execue that script daily ....
     
    krakjoe, Dec 28, 2006 IP
  6. sankarsubramanian

    sankarsubramanian Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ya ok but i am in one place.the server is in another place. i dont know how to use cron. i have created a php file to delete the records
    (example:delrec.php).
    now what is the procedure to do cron?
     
    sankarsubramanian, Dec 28, 2006 IP