prepare($check_sql); $stmt->bind_param("ss", $username, $email); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { echo "Username or email already exists. Please choose a different one."; } else { $sql = "INSERT INTO users (username, email, password) VALUES (?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("sss", $username, $email, $password); if ($stmt->execute() === TRUE) { echo "Registration successful! Login here"; } else { echo "Error: " . $conn->error; } } $stmt->close(); } $conn->close(); ?>