решила так:
$i = 0;
while($i <= 6){
$date = date ("Y-m-d", time() - ( -($i) + date("N")-1) * 24*60*60);
echo $date;
$id_query = "select * from `p_users`
where `p_user_division` = 19 and `p_user_devision_general` = 0 order by `p_user_fname`";
$id_res = mysql_query($id_query) or die(mysql_error());
while ($id_row = mysql_fetch_array($id_res)){
$user_name = $id_row['p_user_id'];
$user_devision = $id_row['p_user_division'];
//$date = date("Y.m.d");
$query = "insert into `p_operativ` values (null, '".$user_name."','".$user_devision."','".$date."',0,0,
0,0,0,0,0)";
$res = mysql_query($query) or die(mysql_error());
var_dump($query);
};
$i++;
};