im running a php script. I want the php script to send a sql code to my database that updates the current users "ally" when a user enters MYSITE.COM/include/fire.php. But I get this error
Notice: Undefined variable: id in C:\Users\Name\Desktop\Folder\htdocs\include\Fire.php on line 14
Line 14: mysql_query("UPDATE users SET ally='3' WHERE id='{$id}'");
The whole fire.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
$verbindung = mysql_connect("localhost","root","Palmen162");
mysql_select_db("lan");
if(isset($_SESSION['id'])) {
// do the following query
}
mysql_query("UPDATE users SET ally='3' WHERE id='{$id}'");
?>
Please help me with this error. Don't give me a link to someone with similar problem. Just help me