Page 1 of 1

Re: php email and mysql issue

Posted: Fri Jun 19, 2015 2:39 pm
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?

Re: php email and mysql issue

Posted: Fri Jun 19, 2015 11:01 pm
by Christopher
So how are they different? And does the test email script still work?

Re: php email and mysql issue

Posted: Sat Jun 20, 2015 7:45 am
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.

Re: php email and mysql issue

Posted: Sat Jun 20, 2015 8:13 am
by Celauran

Re: php email and mysql issue

Posted: Sat Jun 20, 2015 8:15 am
by Celauran
You could even use date() + strtotime();

Code: Select all

date('Y-m-d', strtotime('2015-06-20'));

Re: php email and mysql issue

Posted: Sat Jun 20, 2015 10:02 am
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";