PHP problem - VIP update script

Johno

:: xHosts :: www.xhosts.uk
Sep 12, 2011
581
246
Hey

Im new to php coding but trying to code a update script for my users

here is what i have so far but its not working

<?php
$username = $_SESSION['username'];
$userq = mysql_query("SELECT * FROM users WHERE username = '".$username."' LIMIT 1");
$user = mysql_fetch_array($userq);
mysql_query("UPDATE users SET rank = '3' WHERE username = '".$username."'" "SET credits = '+1000000"');

?>
 

Johno

:: xHosts :: www.xhosts.uk
Sep 12, 2011
581
246
when i visit it, as a logged in user on rank 1, it dont update the rank or coins but takes me back to the me page :s
 

Johno

:: xHosts :: www.xhosts.uk
Sep 12, 2011
581
246
im using the REV cms, were would i include that (sorry to sound noob) but im still learning all about this
 

ImagicianX

New Member
Dec 20, 2010
8
0
Replace your code with:

PHP:
<?php
$username = $_SESSION['username'];
$userq = mysql_query("SELECT username FROM users WHERE username = '".$username."' LIMIT 1");
$user = mysql_fetch_assoc($userq);
mysql_query("UPDATE users SET rank = '3', credits = credits '+1000000' WHERE username = '".$user['username']."'");
?>

Yours, Imagician.
 

Johno

:: xHosts :: www.xhosts.uk
Sep 12, 2011
581
246
i am uploading to a remote server, just need help with the coding side of it, nothing on the server, Thanks
 

Users who are viewing this thread

Top