<?php
include 'config.php';
$stmt=$con->prepare('SELECT * from users WHERE id=?');
$stmt->bind_param('i', $_GET['id']);
$stmt->execute();
$result=$stmt->get_result();
while($row=$result->fetch_assoc()){
$user=$row['username'];
}
echo $user;
?>
Fatal error: Call to undefined method...