rndilger
08-09-2006, 02:45 PM
Hello everyone. I am trying to sort a member list by the first letter of a members last name. To do so, I have a link for each letter of the alphabet as follows:
<a href='members/users.php?action=Directory&sort=letter&letter=A'>A</a>
Then, I have a conditional statement which I use to choose the correct mysql_query:
if($sort == "letter"){
$result = mysql_query("SELECT * FROM ".$prefix."_users ORDER BY lname ASC LIMIT $nexlimit,$users_per_page WHERE lname LIKE '".$letter."%' ");
};
This query works if I remove the where statement. However, I cannot figure out why I receive an invalid argument statement when clicking on one of the letters to sort the list.
Any advice?
Thanks in advance,
Ryan
<a href='members/users.php?action=Directory&sort=letter&letter=A'>A</a>
Then, I have a conditional statement which I use to choose the correct mysql_query:
if($sort == "letter"){
$result = mysql_query("SELECT * FROM ".$prefix."_users ORDER BY lname ASC LIMIT $nexlimit,$users_per_page WHERE lname LIKE '".$letter."%' ");
};
This query works if I remove the where statement. However, I cannot figure out why I receive an invalid argument statement when clicking on one of the letters to sort the list.
Any advice?
Thanks in advance,
Ryan