if( isset($_GET['ltr']) ) { $letter = $_GET['ltr']; } // <snip> $itemcount = $db->query_first(" SELECT COUNT(`uid`) AS `itemcount` FROM `" . TABLE_PREFIX . "mytable` WHERE colname LIKE '" . $letter . "%'");