im currently working on a new game and i can't seem to get this code to update a field in my db. can some please help me with this
<?php
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$gip=make_ip();
function make_ip(){
$inum1 = rand(0,255);
$inum2 = rand(0,255);
$inum3 = rand(0,255);
$inum4 = rand(0,255);
$ip = $inum1.'.'.$inum2.'.'.$inum3.'.'.$inum4;
return $ip;
}
echo "Ip set to"; echo make_ip();
mysql_query("UPDATE users set Gameip=$gip WHERE userid=$userid",$c);
?>