Ok, so i am working on adding getting and adding multiple data at one time. I have a form generated with data (if a hen has laid, and the date) so i am setting some things so i can start to add the data to the database after words. all goes fine and dandy until i work with while loops. I must admit i have never worked with while loops but think they should not be much different than foreach()
here’s the full list
while ( $i <= $totalHens) {
$henLaid.$i = post('hen_'.$i.'_laid');
$henDateLaid.$i = post('hen_'.$i.'_date');
$henId.$i = post('hen_id'.$i);
if($henLaid.$i == 'laid'){
$query .= "($henDateLaid.$i,$henId.$i)";
}
$i++;
}
here’s the full function
$totalHens = post('henCount');
$i = post('startAt');
$query = "INSERT INTO eggs(dateLaid,laidBy) VALUES";
while ( $i <= $totalHens) {
$henLaid.$i = post('hen_'.$i.'_laid');
$henDateLaid.$i = post('hen_'.$i.'_date');
$henId.$i = post('hen_id'.$i);
if($henLaid.$i == 'laid'){
$query .= "($henDateLaid.$i,$henId.$i)";
}
$i++;
}
$Insert = $db->rawQuery($query);
and i have tested it. And it is not building the query , so to me that means it is not retrieving the data. But i am not sure.