Jump to content

Search the Community

Showing results for tags 'email php mysql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have the following code and i know im close but dont have it right. Im trying to setup a cron job to run and pull messages from a database every hour. Here is the code so far. <?php $con = mysql_connect(mine","myuser","mypass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); Need $time setup $today = date("Y-m-d"); I need the query to select the data where i have 3 columns for the date Year-Month_Day and compare it to $today as well as the time Time and Time2. Time holds the time in 12 hr format and time2 holds AM/PM. $result = mysql_query("SELECT * FROM table where Year-Month-Day >= '$today'"); I think the below is correct. What should happen is.... The script should see if the database has any messages that need to be sent today then depending on the hour send those messages to the person. I want the cron job to run hourly to do this. Reason for this is the person creating the messages is able to decide what time they want the message delivered. The closest thing i can compare it to is a alarm clock. sending a message to the email address at a certain time on a certain date. Hope that helps while ($row = mysql_fetch_array($result)) { { $email=$row['emailid']; $to = $EmailAddress; $subject = "You have a Message on mysite.com from $Name"; $body = "$Message"; $headers = 'From: Message@mysite.com' . "\r\n" ; $headers .= 'Reply-To: Message@mysite.com' . "\r\n"; mail($to, $subject, $body, $headers); } mysql_close($con); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.