php email and mysql issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php email and mysql issue

Post by Christopher »

Sending email can be a problem. Is there an SMTP or other program running on your server to deliver mail? Is PHP configured correctly for sending mail? Do you have a simple test script that sends an email to eliminate the chance that the problem is elsewhere?
(#10850)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php email and mysql issue

Post by Christopher »

So how are they different? And does the test email script still work?
(#10850)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php email and mysql issue

Post by Celauran »

Is visitor_mot a DATE field? If it's DATETIME, you'll need to wrap it in DATE first.

Code: Select all

SELECT * FROM visitors WHERE DATE(visitor_mot) = DATE_ADD(CURDATE(), INTERVAL 1 DAY)
Also, you really don't want to be using SELECT *, but that's a whole other discussion.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php email and mysql issue

Post by Celauran »

You could even use date() + strtotime();

Code: Select all

date('Y-m-d', strtotime('2015-06-20'));
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php email and mysql issue

Post by Celauran »

You mean just append it to $message? Just use the concatenation operator.

Code: Select all

$message = "Some stuff here";
$message .= "And more stuff here";
Post Reply