I’ve been working on this for a couple days, and my brain has finally gone numb. My UPDATE is just updating every StartDate in the database, but I want it to only act on the event that is in the while loop this UPDATE is contained in. I think the code is probably fairly obvious, so here it is:
$query = "SELECT * FROM events WHERE ParentEventID='$tempParentEventID' AND GoogleID IS NULL";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$tempDaysFromEvent = $row['DaysFromEvent'];
$tempStartDate = $row['StartDate'];
//IF STARTDATE IS DIFFERENT FROM HOW IT USED TO BE, UPDATE IT.
list($year, $month, $day) = explode("-", $tempStartDate);
$tempStartDate = $tempEndDate = date("Y-m-d", mktime (0,0,0,$month,$day+$tempDaysFromEvent,$year));
mysql_query("UPDATE".$eventDatabase." SET
StartDate = '$tempStartDate'");
}
I hope the above is clear enough. I am trying to change the StartDate in each $row as it goes through the loop.
How about adding a where clause.