note 129550 added to reserved.variables.server
| From: | legenzeld4@gmail.com | Date: | Thu, 06 Jun 2024 13:13:15 +0000 |
| Subject: | note 129550 added to reserved.variables.server | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221353@lists.php.net to get a copy of this message | ||
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "TWA_Quiz";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$studentid = $_POST['studentid']; // Retrieve student ID from form submission
// SQL query to select student information
$sql = "SELECT STUDENTID, FIRSTNAME, LASTNAME, GENDER, GPA FROM STUDENT WHERE STUDENTID =
'$studentid'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Output data of each row
while($row = $result->fetch_assoc()) {
echo "STUDENTID: " . $row["STUDENTID"]. " - Name: " .
$row["FIRSTNAME"]. " " . $row["LASTNAME"]. " - Gender: " .
$row["GENDER"]. " - GPA: " . $row["GPA"]. "<br>";
}
} else {
echo "No student found with STUDENTID: $studentid";
}
$conn->close();
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 1.40.161.252)
----
Manual Page -- https://php.net/manual/en/reserved.variables.server.php
Edit -- https://main.php.net/note/edit/129550
Del: integrated -- https://main.php.net/note/delete/129550/integrated
Del: useless -- https://main.php.net/note/delete/129550/useless
Del: bad code -- https://main.php.net/note/delete/129550/bad+code
Del: spam -- https://main.php.net/note/delete/129550/spam
Del: non-english -- https://main.php.net/note/delete/129550/non-english
Del: in docs -- https://main.php.net/note/delete/129550/in+docs
Del: other reasons-- https://main.php.net/note/delete/129550
Reject -- https://main.php.net/note/reject/129550
Search -- https://main.php.net/manage/user-notes.php