Aha!
So basically, what your saying is that the problem lies in that (unbenownst to me) I was comparing the date output of 2006-12-06 to the UNIX timestamp of 1165388400 etc...???
Also, probably should have clarified the goal of solving for $period for two marketing groups if (condition) $period = date (for gropup1) and if($_group_2) $period = date + 4 days. In that context I have altered to suit however I'm still struggling with what to do about group_2 period. Am I correct in expecting same shortcoming for group_2 expressed in original post -- with following code?
<?php
//GMT -7 hours
$today = strtotime(date('Y-m-d'));
$year = date('Y');
$marketingCycle = array();
$start = strtotime("first wednesday jan $year");
$te = (28 * (3600*24));
$x=0;
$f=0;
while($x<=12){
$f += $te;
++$x;
$marketingCycle[] = ($start+$f)."\n";
}
if ($today < $marketingCycle[11]) {
$period = date('Y-m-d', $marketingCycle[11]);
}else if ($today < $marketingCycle[12]) {
$period = date('Y-m-d', $marketingCycle[12]);
}
$_group_2 = date('Y-m-d', strtotime($period . ' +4 days'));
/*if ($_group =='2'){
$period = date('Y-m-d', strtotime($period . ' +4 days')); //adjust period for group 2*/
echo $period ." -this is the current marketing period<br><br>";
echo $_group_2 ." - this is group_2 marketing period<br>";
?>
The output looks right,
2007-01-03 -this is the current marketing period (group_1)
2007-01-07 - this is group_2's marketing period
but would the following query "fail" to produce the desired update when group_2's marketing period date rolls
around and the following query is run (as it failed for group_1) brining this problem to light in the first place?
$correct_visit_by = " UPDATE accounts SET visit_by = '$period'
where visit_by != '$period' and active='on' ";
$result = @mysql_query ($correct_visit_by); // Run the query.