Basically, I followed this guide to email customers on their birthday. Version 2.1.0.1
I got everything working up to the part where I need to find customers whose birthday is today. Basically it's getting the date back from the database and compare it with today's date.
Right now the code is:
Code: Select all
$findCustomers = mysql_query("SELECT * FROM rwy_customer WHERE birth_date = '" . $todayDate . "'");
while($row = mysql_fetch_array($findCustomers)){
$birthDate = $row['birth_date'];
$birthEmail = $row['bday_email'];
}
Code: Select all
Warning: mysql_query(): Access denied for user 'root'@'localhost' (using password: NO) in /home1/xxx/public_html/catalog/controller/common/header.php on line 116Warning: mysql_query(): A link to the server could not be established in /home1/xxx/public_html/catalog/controller/common/header.php on line 116Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home1/xxxx/public_html/catalog/controller/common/header.php on line 117
Code: Select all
$this->db->query
Code: Select all
$findCustomers = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE birth_date = '" . $todayDate . "'");
while($findCustomers->rows as $result){
$birthDate = $result['birth_date'];
$birthEmail = $result['bday_email'];
}
Code: Select all
Parse error: syntax error, unexpected 'as' (T_AS) in xxxx\public_html\catalog\controller\common\header.php on line 117
If you need the whole guide I follow, it's on the link below.
http://cartadvisor.com/blog/2012/02/28/ ... -opencart/