Thursday, April 19, 2012

Updating a mysql text field with new values

i have a database with start date, end date and text field containing multiple strings, each of them starting with a mysql formatted date within the range of start and end date.



let's say i want to duplicate the record with a new start date and a new end date, i need to update those strings. no problem there. i extract them from the old record and update in the foreach loop with the new date range. except some strings can have the same dates.



$data_acc = explode(';',$record['details_accommodation'], -1);



foreach($data_acc as $row_acc)



            {

list($day,$name,$sgl,$dbl,$tpl,$nights,$status) = explode(',',$row_acc);

}


how can i detect within the loop all the same dates ($day) and update with the new values without incrementing automatically ?





No comments:

Post a Comment