Hello everyone
I am failing to get all records(Rows) from my “learners” table to be inserted into the “attendance” table. Please help!
My first query is not returning the number of rows from the table.
Help... How to get the number of rows in a table
$line = $db->rawQueryValue("SELECT COUNT(*) FROM learners");
for ($i = 1; $i <= $line; $i++){
//query the database and return a single field value
$db->where("Project_ID", $modeldata['Project_ID']);
$db->where("Learner_ID", $i);
$value = $db->getValue("learners", "Learner_ID");
$table_data = array(
"Learner_ID" => $value,
"Project_ID" => $modeldata['Project_ID'],
"Class_ID" => $rec_id
);
$db->insert("attendance", $table_data);
};