mforan Posted November 16, 2008 Share Posted November 16, 2008 $query = "SELECT username,alliance,reports,repip,lastip FROM users WHERE reports >0 ORDER BY username ASC"; $result = mysql_query($query) or die("Error: ".mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { $pow2[] = $row; } ^^^ i want to run the above mysql, but i also want to select "lastip" if the report isnt over 0, but the lastip also exsists on one of the selected ones. so i want to select these 2 because 1 contains 4 or >0: 112 0 112 4 (the above code would only select "112 4") any ideas peeps? Link to comment https://forums.phpfreaks.com/topic/132970-solved-mysql-selection-problem/ Share on other sites More sharing options...
wildteen88 Posted November 16, 2008 Share Posted November 16, 2008 Use >= rather than > Link to comment https://forums.phpfreaks.com/topic/132970-solved-mysql-selection-problem/#findComment-691485 Share on other sites More sharing options...
mforan Posted November 16, 2008 Author Share Posted November 16, 2008 that would select all the values in the database since everyone or every entry has default of 0 lol. Link to comment https://forums.phpfreaks.com/topic/132970-solved-mysql-selection-problem/#findComment-691490 Share on other sites More sharing options...
mforan Posted November 16, 2008 Author Share Posted November 16, 2008 never mind i had a better and probably easier idea, change the way the entry is added in the first place, rofl. Link to comment https://forums.phpfreaks.com/topic/132970-solved-mysql-selection-problem/#findComment-691500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.