All pastes #85508 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-07-12 00:17 UTC
rendered paste body
<?php

//MUST REVIEW! ERROR WITH REFRESHING!


$stat = mysql_query("SELECT * FROM users");
$stats = mysql_fetch_array($stat);


if ($stats[battles] == '3') {
$lvlup = mysql_query("UPDATE users SET 
level = '2', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+8, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '2'");



} elseif ($stats[battles] == '6') {

$lvlup = mysql_query("UPDATE users SET 
level = '3', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '3'");



}elseif ($stats[battles] == '9') {
$lvlup = mysql_query("UPDATE users SET 
level = '4', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '4'");


}elseif ($stats[battles] == '12') {
$lvlup = mysql_query("UPDATE users SET 
level = '5', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '5'");


}elseif ($stats[battles] == '15') {
$lvlup = mysql_query("UPDATE users SET 
level = '6', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '6'");


}elseif ($stats[battles] == '18') {
$lvlup = mysql_query("UPDATE users SET 
level = '7', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '7'");


}elseif ($stats[battles] == '21') {
$lvlup = mysql_query("UPDATE users SET 
level = '8', 
hp = '$stats[hp]'+15, 
mp = '$stats[mp]'+10, 
strength = '$stats[strength]'+4, 
intelligence = '$stats[intelligence]'+8, 
agility = '$stats[agility]'+8
WHERE username = '$logged[username]' AND level != '8'");


}elseif ($stats[battles] == '24') {
$lvlup = mysql_query("UPDATE users SET 
level = '9', 
hp = '$stats[hp]'+35, 
mp = '$stats[mp]'+25, 
strength = '$stats[strength]'+10, 
intelligence = '$stats[intelligence]'+30, 
agility = '$stats[agility]'+40
WHERE username = '$logged[username]' AND level != '9'");


}elseif ($stats[battles] == '30') {
$lvlup = mysql_query("UPDATE users SET 
level = '10', 
WHERE username = '$logged[username]' AND level != '10'");
}
?>