SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    934
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Connecting to a databse in a Cron Job

    I'm trying to set up a cron job that runs a php script that updates a database. It is returning an error that it can't connect.
    The error shows a host other than my domain. Does a cron job typically need special or remote permissions to connect?

    This is on Dreamhost incidentally.

    Thanks for any help.

    E

  2. #2
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be able to connect with no problems. Sounds like an error in your php code if its trying to use another host but seeing as you've opted not to show your code there isn't much else we can help you with.
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this connecting to a MySQL database?

    In the PHP script are you using the mysql_connect() function? If so, what is the first parameter you are giving to it?
    CanisHosting - Web Hosting plans starting at $3.95 per month


Bookmarks

Posting Permissions

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