Good morning,
I am new to programming, so I hope this is not a stupid question. I am creating a page for the music department of a small school. I want parents to be able to register, but before they can do it they need to look up their child/children's info in the database; if the information is found then they can proceed with the registration process.
Therefore, the first part of the registration process is a form that says "Look up your child". I can do this easily if there is only one student:
if(isset($_POST['submit'])) {
$child_last_name = mysqli_real_escape_string($dbc, trim($_POST['child_last_name']));
$child_date_of_birth = mysqli_real_escape_string($dbc, trim($_POST['child_date_of_birth']));
$query = "SELECT student_id, first_name, last_name FROM students where last_name = '$child_last_name' AND dob = STR_TO_DATE('$child_date_of_birth', '%m/%d/%Y')";
$data = mysqli_query($dbc, $query);
if(mysqli_num_rows($data) != 0) {
$children = array();
while($row = mysqli_fetch_array($data)) {
array_push($children, $row);
}
}
}
And below this I have the code for the registration form. So, my question would be, is there a way to look up information about more than 1 student and put it in the same array so that I can use that info later in the registration form for the parent (I will put the student_id in the database for the parents) I only know a little of PHP :(
Any help is GREATLY appreciated.