thefreebielife Posted May 28, 2007 Share Posted May 28, 2007 so i tried updating this script to credit values such as 10, 20, etc. to users "ostatus". But it still only credits 1, and only 1. and the worst part, if a user does more then 1 offer, theyre account still only gets credited 1. before it worked fine when it was fractions and stopped at 1. please let me know what i did wrong. <?php if ($status == 1) { //Added following for crediting Logic if($ip == "75.126.157.90" or "204.10.140.62" or "204.10.140.63") $sql="select oWeight from offers where oCampID='" . $campaign . "'"; else $sql="select oWeight from offers where oName='" . $name . "'"; $result = mysql_query($sql); $oWeight=0.0; if($r=mysql_fetch_array($result)) { if($r['oWeight']=='1') $oWeight=1; else if($r['oWeight']=='5') $oWeight=5; else if($r['oWeight']=='10') $oWeight=10; else if($r['oWeight']=='20') $oWeight=15; else if($r['oWeight']=='25') $oWeight=25; else if($r['oWeight']=='30') $oWeight=30; else if($r['oWeight']=='35') $oWeight=35; else if($r['oWeight']=='45') $oWeight=40; else if($r['oWeight']=='50') $oWeight=50; else if($r['oWeight']=='60') $oWeight=60; } //Updating ostatus with weightage rather then 1 or 0. $totalO=0; $currOStatus=mysql_result(mysql_query("SELECT `ostatus` FROM `users` WHERE `uid`='$sid'"),0); if(($currOStatus+$oWeight)>1) $totalO=100; else $totalO=$currOStatus+$oWeight; php?> Quote Link to comment https://forums.phpfreaks.com/topic/53275-major-crediting-script-problem/ Share on other sites More sharing options...
MadTechie Posted May 28, 2007 Share Posted May 28, 2007 erm.. try this (created on the fly, may have errors) <?php if ($status == 1) { //Added following for crediting Logic if($ip == "75.126.157.90" or "204.10.140.62" or "204.10.140.63") $sql="select oWeight from offers where oCampID='" . $campaign . "'"; else $sql="select oWeight from offers where oName='" . $name . "'"; $result = mysql_query($sql); $oWeight=0.0; if($r=mysql_fetch_array($result)) { $oWeight = (float)$r['oWeight']; } //Updating ostatus with weightage rather then 1 or 0. $totalO=0; $result =mysql_query("SELECT `ostatus` FROM `users` WHERE `uid`='$sid'"); $currOStatus = 0.0; if($r=mysql_fetch_array($result)) { $currOStatus= (float)$r['ostatus']; } if(($currOStatus+$oWeight)>1) $totalO=100; else $totalO=$currOStatus+$oWeight; ?> Quote Link to comment https://forums.phpfreaks.com/topic/53275-major-crediting-script-problem/#findComment-263285 Share on other sites More sharing options...
thefreebielife Posted May 28, 2007 Author Share Posted May 28, 2007 i tired that but now it doesnt even credit. ugh this is so confusing Quote Link to comment https://forums.phpfreaks.com/topic/53275-major-crediting-script-problem/#findComment-263395 Share on other sites More sharing options...
MadTechie Posted May 28, 2007 Share Posted May 28, 2007 without more compleate info/code i can't say $name & $sid aren't being set.. i have no idea what it doesnt even credit. means Quote Link to comment https://forums.phpfreaks.com/topic/53275-major-crediting-script-problem/#findComment-263396 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.