Mod-Jay Posted December 2, 2010 Share Posted December 2, 2010 Hi im trying to make it get the server from the toplist data by the server owner, after that i want it to check if theres more then 1 server if there is i want it to add all the votes together and if there isnt more then 1 i want it to show the votes <?php $votes = mysql_query("SELECT * FROM toplist WHERE serverowner='{$_SESSION['user']}'") or die(mysql_error()); while($vote = mysql_fetch_array($votes)) { if(mysql_num_rows($vote) > 1 { //gets the server votes and adds them } else { $servervotes = $vote['votes']; } echo $servervotes; ?> } Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/ Share on other sites More sharing options...
trq Posted December 2, 2010 Share Posted December 2, 2010 And? Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/#findComment-1142085 Share on other sites More sharing options...
Lostvoices Posted December 2, 2010 Share Posted December 2, 2010 And? Do it For him!! Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/#findComment-1142096 Share on other sites More sharing options...
phpnewbei Posted December 2, 2010 Share Posted December 2, 2010 $votes = mysql_query("SELECT * FROM toplist WHERE serverowner='" . $_SESSION['user'] . "'") or die(mysql_error()); Think it should be like this, not sure though. Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/#findComment-1142218 Share on other sites More sharing options...
Mod-Jay Posted December 2, 2010 Author Share Posted December 2, 2010 Im not sure at all tbh i have no idea how to do this and i would love to learn.. im not making you do it for me but i would like some help on it or a tutorial or something.. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/#findComment-1142227 Share on other sites More sharing options...
phpnewbei Posted December 2, 2010 Share Posted December 2, 2010 Not that good at explaining stuff, haha. Sorry mate, good luck tho! Quote Link to comment https://forums.phpfreaks.com/topic/220414-need-phpmysql-help/#findComment-1142229 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.