I am working on a web application for school, and the goal is to create several classes and put students in it, and I thought that first I would think that it would be an insertion class, and the next thing would be to select these classes and put button next it, which will lead to the selection or insertion of students into this particular class. And I have a problem because I don’t know how to connect buttons to these classes, I think this has something to do with id and attaches it to this button, but I have no idea how to do this.
Two tables, students and classes. students have a class identifier restriction.
$sql = "SELECT id, class_name, year FROM class";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo "id: " . $row["id"]. " - class name: " . $row["class_name"]. " - Year: " . $row["year"]." <button><a href=index.php?content=students>Enter class</a></button>"."<br>";
}
}
krkus source
share