10-06-2016, 02:56 AM
I think it is an issue of scope. You are trying to pull back the lastId outside of the if statement. It should be...
if($db->insert(‘table’,$fields)){
$last_id = $db->lastId();
$yes[] = ‘text’;
}else{
$no[] = ‘text’;
}
}
?>
if($db->insert(‘table’,$fields)){
$last_id = $db->lastId();
$yes[] = ‘text’;
}else{
$no[] = ‘text’;
}
}
?>