Keep getting this and I'm not sure whats really wrong. =/ function get_dropdown () { global $table_games; ?> <form action="" name="quickselect" id="quickselect"> <select onChange="document.location.href=this[selectedIndex].value" class="dropdown"> <option value="#" selected="selected">- Quick Select -</option> <?php $sql = 'SELECT g_name FROM '. $table_games . 'WHERE g_status = 1 ORDER BY g_name ASC'; $result = do_mysql_query($sql); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { echo '<option value="'. get_game_link($row['g_name']) .'">'. $row['g_name'] .'</option>'; } } else { echo '<option value="">No Games To Show</option>'; } ?> </select> </form> <?php } Code (markup):
quick and dirty way of seeing what is the problem is changing $result = do_mysql_query($sql); to $result = do_mysql_query($sql) or die(mysql_error()); and script should stop executing and will display mysql error when you run it
The code in question is here... if (mysql_num_rows($result) > 0) { Code (markup): I'll try the error reporting thing though.
try to echo the table name before accessing that sql query and see if that table name variable changes
yeah but previous line is causing it. when you find out what is the problem with query you will know why mysql_num_rows can't handle it
Oh! Got it fixed somehow. Just looked at the other functions and changed it a bit. Not much though, but it worked. function get_dropdown () { global $table_games; $sql = 'SELECT g_name FROM '. $table_games .' WHERE g_status = 1 ORDER BY g_name ASC'; $result = do_mysql_query($sql); ?> <form action="" name="quickselect" id="quickselect"> <select onChange="document.location.href=this[selectedIndex].value" class="dropdown"> <option value="#" selected="selected">- Quick Select -</option> <?php if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { echo '<option value="'. get_game_link($row['g_name']) .'">'. $row['g_name'] .'</option>'; } } else { echo '<option value="">No Games To Show</option>'; } ?> </select> </form> <?php } Code (markup):