Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql/php update script help

Status
Not open for further replies.

awmphantom

Technical User
Mar 21, 2002
1
US
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(&quot;mainfile.php&quot;);

$userpage = 1;

function lvl101u($uname, $bypass=0) {
global $user, $cookie, $prefix, $user_prefix, $dbi;
$result = sql_query(&quot;select uid, user_rank, lvl101, pass from $user_prefix&quot;._users.&quot; where uname='$uname'&quot;, $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(&quot;update $user_prefix&quot;._users.&quot; set lvl101='$lvl101' WHERE uname='$uname'&quot;, $dbi);
sql_query(&quot;update $user_prefix&quot;._users.&quot; set user_rank='$rank' WHERE uname='$uname'&quot;, $dbi);
}
echo &quot;$uname&quot;;
echo &quot;You opened the page&quot;;
}

lvl101u()

?>

Any help would be appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top