Q:

UPDATE mysql record from php

I'm not a coder by any means. This is not my own code, I got it off Google but I believe it serves my purpose. I am trying to update a mysql record via php. It doesn't work!! This does nothing to the database.
<?php
$con=mysqli_connect("localhost","radius","radius","radius");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

mysqli_query($con,"UPDATE userinfo SET enableportallogin=1 WHERE city='NULL'");
mysqli_close($con);
?>

What is the problem?

A:

if NULL is really NULL (not as string), you should use IS NULL to check for its value,
UPDATE userinfo SET enableportallogin = 1 WHERE city IS NULL

Working with NULL Values

