thebobby Posted April 20, 2012 Share Posted April 20, 2012 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blaz1986/public_html/anewhitlist.php on line 160 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/blaz1986/public_html/anewhitlist.php on line 160 $newer = mysql_query("SELECT * FROM grppusers WHERE id='$target'"); line160 $abcdef=mysql_fetch_object(mysql_query($newer)); if ($abcdef->id == $fetch->id){ echo "You can't hitlist yourself!"; }elseif ($abcdef->id != $fetch->id){ change to mysql_fetch_array and still had error Quote Link to comment Share on other sites More sharing options...
indysolo621 Posted April 20, 2012 Share Posted April 20, 2012 Try $newer = mysql_query("SELECT * FROM grppusers WHERE id='$target'"); line160 $abcdef=mysql_fetch_object($newer); Since $newer is already a query there is no reason to call mysql_query again when you do mysql_fetch_object Quote Link to comment Share on other sites More sharing options...
thebobby Posted April 20, 2012 Author Share Posted April 20, 2012 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/blaz1986/public_html/anewhitlist.php on line 160 still has error Quote Link to comment Share on other sites More sharing options...
Sporto Posted April 20, 2012 Share Posted April 20, 2012 is the spelling of "grppusers" correct? Quote Link to comment Share on other sites More sharing options...
mixmaster Posted April 20, 2012 Share Posted April 20, 2012 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blaz1986/public_html/anewhitlist.php on line 160 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/blaz1986/public_html/anewhitlist.php on line 160 $newer = mysql_query("SELECT * FROM grppusers WHERE id='$target'"); line160 $abcdef=mysql_fetch_object(mysql_query($newer)); if ($abcdef->id == $fetch->id){ echo "You can't hitlist yourself!"; }elseif ($abcdef->id != $fetch->id){ change to mysql_fetch_array and still had error You have spelt grpgusers wrong Quote Link to comment Share on other sites More sharing options...
Sporto Posted April 20, 2012 Share Posted April 20, 2012 dang, that was close... got mine in with 2 minutes to spare... :D Quote Link to comment Share on other sites More sharing options...
mixmaster Posted April 20, 2012 Share Posted April 20, 2012 Haha i didn't reload the page before i commented Quote Link to comment Share on other sites More sharing options...
thebobby Posted April 20, 2012 Author Share Posted April 20, 2012 lol ok that did trick but now dont do anything just blinks Quote Link to comment Share on other sites More sharing options...
thebobby Posted April 20, 2012 Author Share Posted April 20, 2012 (edited) if (strip_tags($_POST['Submit']) && strip_tags($_POST['target']) && strip_tags($_POST['an']) && strip_tags($_POST['amount']) && strip_tags($_POST['reason'])){ $target=strip_tags($_POST['target']); $an=strip_tags($_POST['an']); $amount=intval(strip_tags($_POST['amount'])); $reason=strip_tags($_POST['reason']); if ($an == "1" || $an == "2"){ if ($amount < 100000 || !$amount || ereg('[^0-9]',$amount)){ print "You can only hitlist someone for $100,000+"; }elseif ($amount > 99999 && $amount && !ereg('[^0-9]',$amount)){ $newer = mysql_query("SELECT * FROM grpgusers WHERE id='$target'"); $abcdef=mysql_fetch_object($newer); if ($abcdef->id == $fetch->id){ echo "You can't hitlist yourself!"; }elseif ($abcdef->id != $fetch->id){ $target2 = mysql_query("SELECT * FROM grpgusers WHERE id='$target'"); if($target2->id =='0' or $target2->id =='0'){ print "You can't hitlist Admins or Mods!";}elseif ($target2->id=='0'){ $check=mysql_query("SELECT * FROM grpgusers WHERE id='$target'"); $num=mysql_num_rows($check); if ($num == "0"){ echo "User does not exist."; }elseif ($num != "0"){ if ($an == "2"){ $total_cost=$amount + 100000; }else{ $total_cost=$amount; } if ($total_cost > $fetch->money){ echo "You dont have enough money."; }elseif ($total_cost <= $fetch->money){ mysql_query("INSERT INTO `hitlist3` ( `id` , `paid` , `target` , `reason` , `amount` , `anonymous` ) VALUES ( '', '$username', '$target', '$reason', '$amount', '$an' )"); $new_money = $fetch->money - $total_cost; mysql_query("UPDATE grpgusers SET money=money-$total_cost WHERE id='$username'"); mysql_query("UPDATE grpgusers SET hitlists=hitlists+1 WHERE id='$username'"); echo "User hitlisted"; Edited April 23, 2012 by Djkanna Code tags Quote Link to comment Share on other sites More sharing options...
mixmaster Posted April 20, 2012 Share Posted April 20, 2012 (edited) -Snip (removed long quote along with adding code tags to the above post - DJK) 1 problem = if($target2->id =='0' or $target2->id =='0'){ print "You can't hitlist Admins or Mods!";}elseif ($target2->id=='0'){ Edited April 23, 2012 by Djkanna Quote Link to comment Share on other sites More sharing options...
Faz` Posted April 20, 2012 Share Posted April 20, 2012 Use the Code tags dude! Makes it much easier to read. Quote Link to comment Share on other sites More sharing options...
thebobby Posted April 22, 2012 Author Share Posted April 22, 2012 how do i do that Quote Link to comment Share on other sites More sharing options...
SirChick Posted April 23, 2012 Share Posted April 23, 2012 Surround it with : [ code ] script here [/ code] but remove the spaces in the square brackets.... Quote Link to comment Share on other sites More sharing options...
Djkanna Posted April 23, 2012 Share Posted April 23, 2012 Done it for you, also removed the exceptionally long quote (MM quoting the code). 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.