xoligy Posted September 11, 2008 Share Posted September 11, 2008 Ive been trying to figue out whats up with this for nearly an hr and so far ive got nowhere im really stumped on this. Basically im entering an amount ot add so lets say 1k so i enter "1000" press enter and get "Numbers Only!'" since when wasn't "1000" numbers ??? if ($putmoney) { // pinoywebdev add s $id = cln($id); // pinoywebdev add e $pimp = mysql_fetch_array(mysql_query("SELECT pimp, trn, money FROM $tab[pimp] WHERE id='$id'")); $bank = mysql_fetch_array(mysql_query("SELECT pimp, money FROM $tab[bank] WHERE id='$id'")); $md = ($maxdep) ; if($deposit > $pimp[2]) { echo "<html><body><script language=javascript1.1>alert('You do not have that much money!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif(!preg_match ('/^[0-9][0-9]*$/i', $deposit)) { echo "<html><body><script language=javascript1.1>alert('Numbers Only!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit <= 0) { echo "<html><body><script language=javascript1.1>alert('Please enter a positive ammount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit > $maxdep) { echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($deposit + $bank[1] > $md) { echo "<html><body><script language=javascript1.1>alert('You can not deposit more than the maximum amount!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } elseif($pimp[1] < $depositturns) { echo "<html><body><script language=javascript1.1>alert('You do not have enough turns to deposit.');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; } else { // pinoywebdev add s $depositturns = cln($depositturns); $deposit = cln($deposit); // pinoywebdev add e mysql_query("UPDATE $tab[bank] SET money=money + $deposit WHERE id='$id'"); mysql_query("UPDATE $tab[pimp] SET trn=trn - $depositturns, money=money-$deposit WHERE id='$id'"); echo "<html><body><script language=javascript1.1>alert('Money Deposited');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; report("deposited " . commas($deposit) . "$ to the bank"); } } Link to comment https://forums.phpfreaks.com/topic/123726-i-just-canna-figure-out-what-up-simple-too/ Share on other sites More sharing options...
matthew798 Posted September 11, 2008 Share Posted September 11, 2008 Whats the type of collumn that your using to store said data? I'd use an int. Also, if you have anything like "mysql_real_escape_string" i know that sometime improperly configured it can escape stuff that shouldn't be. And, what is returning the error. MYSQL or PHP? Link to comment https://forums.phpfreaks.com/topic/123726-i-just-canna-figure-out-what-up-simple-too/#findComment-638867 Share on other sites More sharing options...
xoligy Posted September 11, 2008 Author Share Posted September 11, 2008 Not getting an error the db is set to varchar (255) i have somehting the same for withdraw that works thats why im puzzled ??? edit: you can see both version here: http://pastebin.com/pastebin.php?diff=m6a85248e Link to comment https://forums.phpfreaks.com/topic/123726-i-just-canna-figure-out-what-up-simple-too/#findComment-638868 Share on other sites More sharing options...
phpretard Posted September 11, 2008 Share Posted September 11, 2008 All I can really add is you have 2 M's in amount in one of your alerts. it just caught my eye and thought you might want to know. alert('Please enter a positive ammount!'); Link to comment https://forums.phpfreaks.com/topic/123726-i-just-canna-figure-out-what-up-simple-too/#findComment-638871 Share on other sites More sharing options...
xoligy Posted September 11, 2008 Author Share Posted September 11, 2008 Thanks i'll sort that out now and have a look at this code later its doing my head in now lol Link to comment https://forums.phpfreaks.com/topic/123726-i-just-canna-figure-out-what-up-simple-too/#findComment-638876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.