blueman378 Posted December 9, 2007 Share Posted December 9, 2007 hi guys, i have a page, the page stops loading after this is initialized <?php //gameform global $database; $q = "SELECT gName FROM " . games . " ORDER BY `gName` ASC "; $result = $database->query($q) or die("Error: " . mysql_error()); /* Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if( $num_rows == 0 ){ return 'Games not found!'; ?> Quick Play: <select id="games" name="selectgame" onchange= "location = 'showgame.php?game=' + this.options[this.selectedIndex ].value;"> <option value="">--select a game--</option> <?php while( $row = mysql_fetch_assoc($result) ) { echo '<option value="' . $row['gName'] . '">'; echo $row[gName] . '</option>'; } } ?> </select> any ideas? Quote Link to comment Share on other sites More sharing options...
JacobYaYa Posted December 9, 2007 Share Posted December 9, 2007 In that while loop down the bottom you got $row[gName] (no quotes). Quote Link to comment Share on other sites More sharing options...
blueman378 Posted December 9, 2007 Author Share Posted December 9, 2007 thanks, the actual problem was i had no games installed, so because it could not find any games... well this part kills the script : if( $num_rows == 0 ){ return 'Games not found!'; so a simple solution... I KILLED IT 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.