hi all,
I have the following code (part of it):
$query = "INSERT INTO eyfs_register (register_id, am, pm, student_info_id)
VALUES (:register_id, :am, :pm, :student_info_id)";
$statement = $conn->prepare($query);
$statement->bindValue(":register_id", $register_id);
$statement->bindValue(":am", $am);
$statement->bindValue(":pm", $pm);
$statement->bindValue(":student_info_id", $student_info_id);
$statement->execute();
$conn->commit();
the student info id which is in bold, is not a user input within the form. it is displayed as text read from another table. the question is as seen as in this eyfs_register table a column with student_info_id exists and is a foreign key, i need a copy of the id to be inserted.
I know it cannot be passed through as a variable would be which is input in a form. How would i do it? it is just a simple row within the form :
echo "<td><h3>" . $row['student_info_id'] . "</h3></td>";