MadTechie Posted June 8, 2009 Share Posted June 8, 2009 The script is doing exactly what you programmed it to do! but its still not working. Thats really not that useful! Quote Link to comment https://forums.phpfreaks.com/topic/161307-help/page/2/#findComment-851668 Share on other sites More sharing options...
seany123 Posted June 8, 2009 Author Share Posted June 8, 2009 okay when i run the script im making it so $Mamount is bigger than $gang['money'] so this code should echo the $errmsg and not run any queries or echo anything afterwards. else if (isset($_POST['Mamount']) && $_POST['Mamount'] < $gang['money']) { /** * WHERE IS $gang['money'] set?? */ $errmsg .= "You cannot send this amount of Money!<p />"; $error = 1; } else { but it does... its still running and echoing the following code... if (isset($_POST['Mamount']) && $_POST['Mamount'] >= $gang['money']) { $query = $db->execute("update `gangs` set `money`=? where `id`=?", array($gang['money'] - $Mamount, $player->gang_id)); $query1 = $db->execute("update `players` set `money`=? where `username`=?", array($member['money'] + $Mamount, $member['username'])); $logmsg = "You were given <b>$" . number_format($Mamount) . "</b> money from <b>". $gang['name'] ."</b>."; addlog($member['id'], $logmsg, $db); $msg .= "You have transferred <b>" . number_format($Mamount) . "</b> points to <b>$username</b>.<p />"; EDIT: oops i may have found the problem >.< Quote Link to comment https://forums.phpfreaks.com/topic/161307-help/page/2/#findComment-851673 Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Just for me, could you note the problem? Quote Link to comment https://forums.phpfreaks.com/topic/161307-help/page/2/#findComment-851745 Share on other sites More sharing options...
MadTechie Posted June 8, 2009 Share Posted June 8, 2009 okay when i run the script im making it so $Mamount is bigger than $gang['money'] so this code should echo the $errmsg and not run any queries or echo anything afterwards. $Mamount isn't being used in this code but let assume you mean $_POST['Mamount'] else if (isset($_POST['Mamount']) && $_POST['Mamount'] < $gang['money']) but it does... its still running and echoing the following code... Erm... but $_POST['Mamount'] < $gang['money'] means if $_POST['Mamount'] is less then $gang['money'] report and error BUT you are say it should be the other away around! Which you did test here doesn't make any sense as for it to get here it must fail! as condition! if (isset($_POST['Mamount']) && $_POST['Mamount'] >= $gang['money']) BUT theirs no point checking your same logic twice so just remove the incorrect one! Quote Link to comment https://forums.phpfreaks.com/topic/161307-help/page/2/#findComment-851772 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.