PC Nerd Posted February 4, 2007 Share Posted February 4, 2007 hi guys im having trouble with the following SQL, the error i receive is: Query died: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=< 20 ORDER BY Rank, User_Name' at line 1 CODE $lower_page_num = $start_page * 20; $higher_page_num = ($start_page + 1) * 20; $curr_page_SQL = "SELECT User_Name, Points, Rank, Resource_1 FROM General_Stats WHERE Rank >= ".$lower_page_num." AND =< ".$higher_page_num." ORDER BY Rank, User_Name"; $curr_page_query = mysqli_query($DB_Server, $curr_page_SQL) or die("Query died: ".mysqli_error($DB_Server)); thanks for any help PC Nerd Quote Link to comment Share on other sites More sharing options...
Tyche Posted February 4, 2007 Share Posted February 4, 2007 Use "<=" not "=<" as below $curr_page_SQL = "SELECT User_Name, Points, Rank, Resource_1 FROM General_Stats WHERE Rank >= ".$lower_page_num." AND <= ".$higher_page_num." ORDER BY Rank, User_Name"; Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Author Share Posted February 4, 2007 still the error: Query died: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= 20 ORDER BY Rank, User_Name' at line 1 thanx anywayz, anything else i should try Quote Link to comment Share on other sites More sharing options...
Tyche Posted February 4, 2007 Share Posted February 4, 2007 Add the field name before the <= $curr_page_SQL = "SELECT User_Name, Points, Rank, Resource_1 FROM General_Stats WHERE Rank >= ".$lower_page_num." AND RANK <= ".$higher_page_num." ORDER BY Rank, User_Name"; Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Author Share Posted February 4, 2007 Tyche: both of your suggestions worked, both the SQL and the html formatting one earlier, thanx so much 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.