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.... Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/ 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. Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598556 Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 and whats the full query for $row? Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598557 Share on other sites More sharing options...
vbnullchar Posted July 24, 2008 Share Posted July 24, 2008 $query = "update virtuala SET cash=cash+600 " ...... ; Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598559 Share on other sites More sharing options...
Orionsbelter Posted July 24, 2008 Share Posted July 24, 2008 $cash = ($row['cash'] + 600); Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598561 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 Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598562 Share on other sites More sharing options...
ronnie88 Posted July 24, 2008 Author Share Posted July 24, 2008 thanks very much works great Link to comment https://forums.phpfreaks.com/topic/116402-solved-help-plz/#findComment-598568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.