All pastes #537130 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-04 17:09 UTC
rendered paste body
//Switch User Levels
			$userpts = $db->getOne('SELECT points from ! WHERE id = ?',  array( USER_TABLE, $_SESSION['UserId']));
			if(count($userpts) > 0 && count($userpts) < 50) {
			$db->Query ( 'UPDATE ! SET level = 4 WHERE id = ?', array ( USER_TABLE, $_SESSION['UserId'] ) );  
			}
			elseif(count($userpts) > 50 && count($userpts) < 300) {
			$db->Query ( 'UPDATE ! SET level = 5 WHERE id = ?', array ( USER_TABLE, $_SESSION['UserId'] ) );  
			}
			elseif(count($userpts) > 300 && count($userpts) < 800) {
			$db->Query ( 'UPDATE ! SET level = 6 WHERE id = ?', array ( USER_TABLE, $_SESSION['UserId'] ) );  
			}	
			elseif(count($userpts) > 800 && count($userpts) < 1800) {
			$db->Query ( 'UPDATE ! SET level = 7 WHERE id = ?', array ( USER_TABLE, $_SESSION['UserId'] ) );  
			}