Zepo. Posted January 29, 2008 Share Posted January 29, 2008 I have a memberlist where you select a letter ect. How do you make a mysql pull where username starts with $letr Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/ Share on other sites More sharing options...
marcus Posted January 29, 2008 Share Posted January 29, 2008 SELECT * FROM `users` WHERE `username` LIKE '".$letter."%' Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451831 Share on other sites More sharing options...
Zepo. Posted January 29, 2008 Author Share Posted January 29, 2008 Ok thank you, i also have a number link how would i do that? Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451832 Share on other sites More sharing options...
marcus Posted January 29, 2008 Share Posted January 29, 2008 same way. // from beginning LIKE '".$letter."%' // from end LIKE '%".$letter."' // in the string LIKE '%".$letter."' Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451835 Share on other sites More sharing options...
Zepo. Posted January 29, 2008 Author Share Posted January 29, 2008 http://eliteladders.com/development/members.php Doesnt show anything if(isset($ltr)){ $letter="WHERE 'name' LIKE '".$ltr."%'"; $letterlink="<r=$ltr"; } $stafflist=mysql_query("SELECT id,name,email,aim,website,points,country,lastactive,DATE_FORMAT(joined,'%M %d, %Y') FROM members $letter ORDER BY name LIMIT $page,25"); while(list($id,$name,$email,$aim,$website,$points,$country,$lastactive,$joined)=mysql_fetch_row($stafflist)){ Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451841 Share on other sites More sharing options...
Zepo. Posted January 29, 2008 Author Share Posted January 29, 2008 bump Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451884 Share on other sites More sharing options...
Guernica Posted January 29, 2008 Share Posted January 29, 2008 Where is the display? Its just a mysql query... Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451889 Share on other sites More sharing options...
Zepo. Posted January 29, 2008 Author Share Posted January 29, 2008 http://eliteladders.com/development/members.php There is no error. Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-451890 Share on other sites More sharing options...
Zepo. Posted February 2, 2008 Author Share Posted February 2, 2008 Bump Link to comment https://forums.phpfreaks.com/topic/88298-pulling-from-database/#findComment-456277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.