Jump to content

ctn8iv

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ctn8iv's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a MySQL table that contains hundreds of store names, so I want to create an alphabetical listing grouped by letter. However, using the SQL and PHP below, I can only get the first record for each letter. What am I missing? SELECT *, substring(store,1,1) AS first_letter, count(*) AS store_cnt FROM stores GROUP BY first_letter ORDER BY store; <?php $row = 0; while ($item = mysql_fetch_array($qry_stores)) { $row = $row + 1; echo $item['store']; ?><br /> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.