ensellitis Posted March 23, 2010 Share Posted March 23, 2010 I have looked and looked, and I have yet to find an answer to this. Maybe I have just gone retarded... $threeup1 = $upuser['3up1']; $threeup2 = $upuser['3up2']; $threeup3 = $upuser['3up3']; if($threeup1 !== "0" && $threeup2 !== "0" && $threeup3 !== "0"){ } What I am trying to do is pull the the info from $threeup1, $threeup2, and $threeup3 from 3 seperate DB rows, and use the info in one spot. So if the IDs where repectively 2,10, 12... I want to grab all 3 of their "level" columns and check them. The script works like this: If all 3 are level 1 or higher (but all are atleast level 1), it makes you level 2. The same for all levels up to 5. I hope that makes sense, I tried to give as much detail as possible so you can see what I am trying to do. Help would be much appreciated. Quote Link to comment Share on other sites More sharing options...
schilly Posted March 23, 2010 Share Posted March 23, 2010 if $upuser is your db row then you aren't getting 3 separate db rows. you're pulling from the same row. if you want from three different rows in your result set then i think you want something like this: //get level from three consecutive rows in the result set from the db query $threeup1 = mysql_result($dbresults,0,'level'); $threeup2 = mysql_result($dbresults,1,'level'); $threeup3 = mysql_result($dbresults,2,'level'); //make sure all are greater than or equal to 1 if($threeup1 >= 1 && $threeup2 >= 1 && $threeup3 >= 1){ //level up } Quote Link to comment Share on other sites More sharing options...
ensellitis Posted March 23, 2010 Author Share Posted March 23, 2010 Thanks! 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.