I maybe don't know what im talking about, but I will give it a try.
I want this code to update this http://prntscr.com/4t9a4u value to 3 for the user who enters "mysite.com/earth.php". Not for somebody else. Just for the user who enters this page. So I want this code to read what id the user have and then update the current users "ally" value from -1 to 3 in the database. Do you know how? Ask me if you want me to explain more.
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
$verbindung = mysql_connect("localhost","root","****");
mysql_select_db("lan");
// setting up value in session
$_SESSION['id'] = $id; //or $id your variable
if(isset($_SESSION['id'])) {
mysql_query("UPDATE users SET ally='3' WHERE id='".$_SESSION['id']."'");
}
?>