awmphantom
Technical User
I'm trying to update a mySQL dbase through php and i can't get it to work.
the following is the basic script that i have so far:
<?php
require_once("mainfile.php"
$userpage = 1;
function lvl101u($uname, $bypass=0) {
global $user, $cookie, $prefix, $user_prefix, $dbi;
$result = sql_query("select uid, user_rank, lvl101, pass from $user_prefix"._users." where uname='$uname'", $dbi);
$userinfo = sql_fetch_array($result, $dbi);
if(!$bypass) cookiedecode($user);
if(($uname == $cookie[1]) AND ($userinfo[pass] == $cookie[2])) {
$lvl101 = 'yes';
$rank = $userinfo[user_rank] + 100;
sql_query("update $user_prefix"._users." set lvl101='$lvl101' WHERE uname='$uname'", $dbi);
sql_query("update $user_prefix"._users." set user_rank='$rank' WHERE uname='$uname'", $dbi);
}
echo "$uname";
echo "You opened the page";
}
lvl101u()
?>
Any help would be appreciated
the following is the basic script that i have so far:
<?php
require_once("mainfile.php"
$userpage = 1;
function lvl101u($uname, $bypass=0) {
global $user, $cookie, $prefix, $user_prefix, $dbi;
$result = sql_query("select uid, user_rank, lvl101, pass from $user_prefix"._users." where uname='$uname'", $dbi);
$userinfo = sql_fetch_array($result, $dbi);
if(!$bypass) cookiedecode($user);
if(($uname == $cookie[1]) AND ($userinfo[pass] == $cookie[2])) {
$lvl101 = 'yes';
$rank = $userinfo[user_rank] + 100;
sql_query("update $user_prefix"._users." set lvl101='$lvl101' WHERE uname='$uname'", $dbi);
sql_query("update $user_prefix"._users." set user_rank='$rank' WHERE uname='$uname'", $dbi);
}
echo "$uname";
echo "You opened the page";
}
lvl101u()
?>
Any help would be appreciated