Students Marklist Preparation Using Database Connection
Students Marklist Preparation Using Database Connection
Source Code:
<?php
// Define the database connection details
$host = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'studentdb';
if (mysqli_query($conn, $sql)) {
echo "Table students created successfully\n";
} else {
echo "Error creating table: " .mysqli_error($conn) . "\n";
}
if (mysqli_query($conn, $sql)) {
echo "Records inserted successfully\n";
} else {
echo "Error inserting records: " .mysqli_error($conn) . "\n";
}
echo "<tr>";
echo "<td>$name</td>";
echo "<td>$maths</td>";
echo "<td>$science</td>";
echo "<td>$english</td>";
echo "<td>$total</td>";
echo "<td>$average</td>";
echo "</tr>";
}
Output: