Can’t take data from mysql while using $citizenid

  mysql, php

so i can’t take data from mysql when i put into the query $citizenid, who returns the unique 8 digits code of a member and if i’m using $citizenid it only returns the citizenid from database, but if i put that manually, its working just perfect, any ideas?

$con=mysqli_connect("localhost","ye","yeye","yeeee");

if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

// $records = mysqli_query($con,"select * from players where `citizenid` = '$citizenid'"); // Not working
$records = mysqli_query($con,"select * from players where `citizenid` = 'YHN76994'");
while($row = mysqli_fetch_array($records)) 
echo "<h3>". $row['name'] ."</h3>";
mysqli_close($con);
?>```

Source: Ask PHP

LEAVE A COMMENT