07-30-db/userAddEdit.php
<?php
require("authUser.php");

/* Setup the Connection Parameters */
$host = "127.0.0.1";
$user = "nerdarmy";
$pass = "";
$db = "testDB";
$port = 3306;

/* make a connection to the mySQL database */
$connection = mysqli_connect($host, $user, $pass, $db, $port) 
    or die(mysql_error());


$UID = $_GET["UID"];

if (isset($UID)) {
    $title = "User Edit";
    $query = "SELECT * FROM Users WHERE UID=" . $UID;
    $result = mysqli_query($connection, $query);
    $row = mysqli_fetch_assoc($result);
    $USERNAME = $row['USERNAME'];
    $EMAIL = $row['EMAIL'];
    $PASSWORD = $row['PASSWORD'];
    $ISADMIN = $row['ISADMIN'];
} else {
    $UID = "0";
    $title = "User Add";
    $USERNAME = "";
    $EMAIL = "";
    $PASSWORD = "";
    $ISADMIN = 0;
}
?>

<!DOCTYPE html>
<title><?php echo($title); ?></title>

<?php include("navBar.php"); ?>

<h2><?php echo($title); ?> Page</h2>

<p>
    <a href="userList.php">User List</a>
</p>

<form action="userAddEditPost.php" method="GET">

<input name="UID" type="hidden" value="<?php echo($UID); ?>">

<table>
    
    <tr>
        <td>User Name:</td>
        <td><input name="USERNAME" type="text" value="<?php echo($USERNAME); ?>"></td>
    </tr>
    
    <tr>
        <td>Email:</td>
        <td><input name="EMAIL" type="text" value="<?php echo($EMAIL); ?>"></td>
    </tr>
    
    <tr>
        <td>Password:</td>
        <td><input name="PASSWORD" type="text" value="<?php echo($PASSWORD); ?>"></td>
    </tr>

    <tr>
        <td>Is Admin:</td>    
        <td>
            <input name="ISADMIN" type="checkbox" value="1" <?php if ($ISADMIN=="1") { echo("checked"); } ?>>
        </td>
    </tr>
    
    <tr>
        <td></td>
        <td><input name="SUBMIT" type="submit"></td>
    </tr>
    
</table>

    
</form>