I know I am having a syntax error here but I can't figure this out.
I'm trying to get the result of a single specific record in my database to display in a PHP variable. Seems simple enough but apparently not for me. Here is the code I'm trying to run:
// Create connection
$con=mysqli_connect($mysqlserver,$mysqluser,$mysqlpass,$mysqldb);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$SQL = "SELECT * FROM players_brixx_gastonia WHERE email='catheygreaney@example.com'";
$result = mysqli_query($SQL,$con);
$result1 = mysqli_fetch_assoc($result);
$prevpoints1 = $result1['points'];
echo $prevpoints1;
mysqli_close($con);
My page is outputting: "Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in"
Which normally means my query is failing however when running the query by itself in phpmyadmin, it completes just fine displaying the row I need.
Whats up with this?
UPDATE:
KaNch solved my issue. Thanks!