paulman888888 Posted June 2, 2008 Share Posted June 2, 2008 I have my code but i want to show only results with the same gameid and $_get['gameid'] heree is my code that i think i need to edit but dont know how. $result = mysql_query("SELECT * FROM myscore2 ORDER BY score DESC") Thankyou Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 2, 2008 Share Posted June 2, 2008 If gameid is an integer: $result = mysql_query("SELECT * FROM myscore2 WHERE gameid=$_GET['gameid'] ORDER BY score DESC") Otherwise: $result = mysql_query("SELECT * FROM myscore2 WHERE gameid='".$_GET['gameid']."' ORDER BY score DESC") Quote Link to comment Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 Don't forget to sanitize mysql_real_escape_string($_GET['gameid']) Damn that function name is WAY too long 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.