connect_error) { die("Connection failed: " . $conn->connect_error); } // Get the logged-in user's email from the session $email = $_SESSION["loggedInUser"]; // Create SQL query using prepared statements $sql = "SELECT username, email, streak FROM registration WHERE email = ?"; $stmt = $conn->prepare($sql); // Check if the statement was prepared successfully if (!$stmt) { die("SQL Error: " . $conn->error); } // Bind the parameter $stmt->bind_param("s", $email); // Execute the query $stmt->execute(); // Get the result of the query $result = $stmt->get_result(); // Check if the user exists if ($result->num_rows > 0) { // Fetch the user's data $user = $result->fetch_assoc(); $userName = $user['username']; $userEmail = $user['email']; $userStreak = $user['streak']; } else { // If no user found, set default values $userName = "Guest"; $userEmail = "Not Found"; $userStreak = 0; } // Close the statement and connection $stmt->close(); $conn->close(); ?> User Profile

Welcome to Info Path

Your one-stop destination for quality content and services.

Home

Explore our latest updates and featured content.

About

Learn more about us.

Services

Discover what we offer to meet your needs.

Contact

Get in touch with us for any inquiries.

User Profile

Name:

Email:

Streak: