ronnie88 Posted July 24, 2008 Share Posted July 24, 2008 Hi I need help again.... I know this is probley all wrong..... <?php session_start(); include 'database.php'; if(!strstr($_SERVER['HTTP_REFERER'],"virtualairlineonline.com/blue_sky/flying2h.php")) { echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY"; } $cash = ({$row['cash']} + 600); $query = "SELECT cash FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); $query = "UPDATE virtuala SET cash = '$cash' WHERE username = '{$_SESSION['username']}'"; mysql_query($query) or die('Error, query failed'); echo "$_SESSION[username] your virtual airline has been set to $va Press the back button"; ?> I'm trying to add 600 to the column cash any help would be great.... Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 you should make your title more descriptive next time. Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 and whats the full query for $row? Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 24, 2008 Share Posted July 24, 2008 $query = "update virtuala SET cash=cash+600 " ...... ; Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 $cash = ($row['cash'] + 600); Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 $query = "UPDATE virtuala SET cash = cash+600 WHERE username = '{$_SESSION['username']}'"; try that and post back Quote Link to comment Share on other sites More sharing options...
ronnie88 Posted July 24, 2008 Author Share Posted July 24, 2008 thanks very much works great Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.