Twister1004 Posted February 15, 2009 Share Posted February 15, 2009 Hey everyone. I've been trying to do this for about 25 mins, so I'm a little irritable! Objective: I'm making a comment thingy right now, however, now I'm adding in a feature where you can delete your own post, or if you're an admin (Level 5) you will have access to delete any post you want. Issue: Any time I try to change the Power level to match "5" or grater than 4, it changes the issue with Every account that is not that level. Code: $getComments = mysql_query("SELECT * FROM `comments` WHERE `profileid` = '{$_GET['user']}' ORDER BY `commentid` DESC LIMIT 5"); while($comments = mysql_fetch_array($getComments)){ if($_SESSION['power'] == "5"){ echo $comments['name'] . " says: (" . $comments['date'] . ") : <a href=\"?user={$_GET['user']}&delete={$comments['commentid']}\"> X </a><br/> " . stripslashes($comments['comment']) . "<br/>"; } elseif($comments['accountid'] == $_SESSION['id']){ echo $comments['name'] . " says: (" . $comments['date'] . ") : <a href=\"?user={$_GET['user']}&delete={$comments['commentid']}\"> X </a><br/> " . stripslashes($comments['comment']) . "<br/>"; } else { echo $comments['name'] . " says: (" . $comments['date'] . ") :<br/> " . stripslashes($comments['comment']) . "<br/>"; } } if(isset($_GET['delete'])){ $deleteme = mysql_query("DELETE FROM `comments` WHERE `commentid` = '{$_GET['delete']}'"); if($deleteme){ echo "Comment Deleted"; echo "<meta http-equiv=\"refresh\" content=\"2; url='?user={$_GET['user']}'\"/>"; } } If you have any questions about my post in my script, let me know =). Quote Link to comment Share on other sites More sharing options...
Twister1004 Posted February 15, 2009 Author Share Posted February 15, 2009 Does anyone have an Idea? Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 Did you try testing it against an int (eg. change "5" to 5 without quotes)? I don't know why it would matter, but you could try it. adding echo $_SESSION['power'] in the script will allow you to be 100% sure the power level is correct before you compare it... I'm not quite sure what your problem is Quote Link to comment Share on other sites More sharing options...
Twister1004 Posted February 15, 2009 Author Share Posted February 15, 2009 Ok. Well when I try to use the "Power" to be equal to 5, determining by what quotes will either work for everyone, or using single quotes will not work, or by itself will not work for anyone. Quote Link to comment Share on other sites More sharing options...
Twister1004 Posted February 15, 2009 Author Share Posted February 15, 2009 Ok, well I fixed it somehow, after I checked the same script 5 times, and just stopped for a few hours, and started finding out what's wrong, it worked now. Creepy. Thanks everyon =) 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.