php mysql create an entry into a field. (INSERT INTO) WHILE logged in currentuser/session

I did the php registration system and it works

but i created extra fields in the DB so the user can add some data to the database.

All search results are only to add to database from scratch, not from CURRENT SESSION USER. or they are just how to make php user reg systems but no further PHP CURRENT SESSION user interaction with DB

DB structure is just like on that site, i posted above, but created a URL field so a user can save their favorite URL. DB = **users > username > URL ** once i get that working im going to figure out how a user can append to the field and keep adding URLs

i came up with this.. .

if (isset($  _SESSION['loggedin']) && $  _SESSION['loggedin'] == true) { echo "<a href="file.php?save=yes>Add to Favorites</a>";}   if(isset($  _GET['save'])){          echo "got a save";      userID = $  _SESSION["username"];      echo $  userID; //it does give the current username, meaning im logged in , session-start is on the header .        $  URL = $  _GET['URLforbookmark'];      $  sql = "INSERT INTO users (URL, UserID)      VALUES ('$  URL', '$  UserID')";            if (mysqli_query($  sql)) {         echo "New record created successfully !";      } else {         echo "Error: " . $  sql . " " . mysqli_error($  sql);      }      mysqli_close($  sql); } 

Feedback Error reads: Error: INSERT INTO users (test, UserID) VALUES (‘theusersfavorurl’, ”)

thank you !