dose Posted June 13, 2010 Share Posted June 13, 2010 Sorry if my title dont make sense. Im trying to pageinate by abc 0-9 and . ive got the abc part to work but i dont know how to include the 0-9 and the . heres what i got. $abc = htmlentities($_GET['abc']); $a = "A"; $letters = range('A', 'Z'); $menu = '<ul class="submenu">'."\n"; foreach($letters as $letter) { if($letter == "A") { $menu .= '<li class="first"><a href="/games/A">A</a></li>'; } else { $menu .= '<li><a href="/games/'. $letter .'">'. $letter .'</a></li>'; } } $menu .= '</ul>'."\n"; if(isset($abc) AND in_array($abc, $letters)) { $games = array(); $result = $db->query("SELECT games.title, games.gameid FROM games WHERE title LIKE '". $abc ."%' GROUP BY title ORDER BY title ASC"); while($array = $db->fetch($result)) { $games[] = $array; } } Quote Link to comment https://forums.phpfreaks.com/topic/204631-abc-0-9-search/ Share on other sites More sharing options...
dose Posted June 13, 2010 Author Share Posted June 13, 2010 nevermind i found what i needed =) googles a life saver lol.. if anyone else needs to know this is what i did. $result = $db->query("SELECT games.title, games.gameid FROM games WHERE title REGEXP '^[0-9\\.]' GROUP BY title ORDER BY title ASC"); Quote Link to comment https://forums.phpfreaks.com/topic/204631-abc-0-9-search/#findComment-1071392 Share on other sites More sharing options...
James25 Posted June 14, 2010 Share Posted June 14, 2010 great dude, go ahead, good luck! Quote Link to comment https://forums.phpfreaks.com/topic/204631-abc-0-9-search/#findComment-1071731 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.