I see, I thought you suggested that writing 2 instances of NOW() in the same statement was bad syntax.
The trouble surfaced when we found about 20 records (of about 50,000) which retrieved a bad date. The process is:
- use PHP to get the current date: date(‘Y-m-j’)
- add the number of months to the current date (it’s a magazine subscription) creating $member_exp, which is the all-important expiration date of the subscription.
This was returning the old 12/31/1969. It then correctly adds the number of months to that date. Next I insert the data using the following statement:
$q = "INSERT
INTO members
(name,
birth_date,
phone,
email,
spouse_name,
spouse_birth_date,
spouse_email,
ship_street,
ship_city,
ship_state,
ship_zip,
intl_ship_street,
intl_ship_city,
intl_ship_zip,
intl_ship_country,
member_since,
exp_date,
recent_order_date,
status,
magazine,
mailing_list,
date_created)
VALUES
('$name',
'$birth_date',
'$phone',
'$email',
'$spouse_name',
'$spouse_birth_date',
'$spouse_email',
'$ship_street',
'$ship_city',
'$ship_state',
'$ship_zip',
'$intl_ship_street',
'$intl_ship_city',
'$intl_ship_zip',
'$intl_ship_country',
'$date',
'$member_exp',
NOW(),
'active',
'1',
'1',
NOW())";
In only a handful of records, the 2 instances of NOW() are recording very different times. Sometimes a few minutes apart, other times a few hours apart!