Advertisement
Tugamars_PT

Untitled

Jun 5th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $rs = mysql_query("SELECT * FROM `equipas` ORDER BY team_name");
  2. $rs1 = mysql_query("SELECT * FROM `equipas` ORDER BY team_name");
  3. while ($rec = mysql_fetch_assoc($rs1)) {
  4. if ($initial1 !== strtoupper(substr($rec['team_name'], 0, 1)) ) {
  5. $initial1 = strtoupper(substr($rec['team_name'], 0, 1));
  6. echo "<a href=\"#".$initial1."\">" . $initial1 . "</a> ";
  7. }
  8. }
  9.  
  10. echo "<br><br>";
  11. while ($rec = mysql_fetch_assoc($rs)) {
  12. if ($initial !== strtoupper(substr($rec['team_name'], 0, 1)) ) {
  13. $initial = strtoupper(substr($rec['team_name'], 0, 1));
  14. echo "<br>" . "<a name=\"".$initial."\">" . $initial . "</a>" . "<br><br>";
  15. }
  16. echo "<img src=\"http://fraglider.pt/imagensup/".$rec['team_logo']."\"> " . $rec['team_name'] . "<br>";
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement