Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default MySQL by Letter

    What would you guys say was the easiest and best way to get a list of users
    details by letter.
    Eg: getusers.php?l=A

    Is there a MySQL command that I can use to get data by firstletter of a
    specific field?
    Or do I have to retrieve all and then loop through only showing relevant
    results?

    The second way seems a big waste of resources.
    Many Thanks

    Richard Grove







    ®ed Eye Media - Richard Grove Guest

  2. Similar Questions and Discussions

    1. Changing from half letter to letter document size
      I have a document that was created in the size it will be (5.5" x 8.8") and it will be punched on the spine side. It has a slightly larger margin on...
    2. Missing letter, letter replaced
      I have save to postscript format from Indesign CS2 before distilling to pdf format. My platform is Max OS X, 384 MB ram. Issue: When I distill...
    3. ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
      When i try to start my mysql server, i get this error ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'...
    4. Capital letter to small letter in Flash MX
      Hi there I am doing a search tool in Flash MX and using a .xml as the archive containing the text At the moment I am using "indexof" as the...
    5. letter by letter text display
      My friend had an idea for a site, where he wanted text to be typed out letter by letter in a movie. Not inputed by the user, but displayed by the...
  3. #2

    Default Re: MySQL by Letter


    "®ed Eye Media - Richard Grove" <info@redeyemedia.co.uk> wrote in message
    news:407124a2$0$95317$65c69314@mercury.nildram.net ...
    > What would you guys say was the easiest and best way to get a list of
    users
    > details by letter.
    > Eg: getusers.php?l=A
    >
    > Is there a MySQL command that I can use to get data by firstletter of a
    > specific field?
    > Or do I have to retrieve all and then loop through only showing relevant
    > results?
    >
    > The second way seems a big waste of resources.
    > Many Thanks
    >
    > Richard Grove
    >
    >
    No Worries,
    Sometime the easiest things are staring you straing in the face.
    Richard Grove


    ®ed Eye Media - Richard Grove Guest

  4. #3

    Default Re: MySQL by Letter

    ®ed Eye Media - Richard Grove wrote:
    > What would you guys say was the easiest and best way to get a list of
    > users details by letter.
    > Eg: getusers.php?l=A
    >
    > Is there a MySQL command that I can use to get data by firstletter of
    > a specific field?
    SELECT ... FROM ... WHERE specific_field LIKE 'a%'

    --
    MVH Jeppe Uhd - NX [url]http://nx.dk[/url]
    Webhosting for nørder og andet godtfolk


    Jeppe Uhd Guest

  5. #4

    Default Re: MySQL by Letter

    ®ed Eye Media - Richard Grove wrote:
    > What would you guys say was the easiest and best way to get a list of
    > users details by letter.
    > Eg: getusers.php?l=A
    >
    > Is there a MySQL command that I can use to get data by firstletter of a
    > specific field?
    > Or do I have to retrieve all and then loop through only showing relevant
    > results?
    Pretty standard sql:

    select fieldname from tablename where fieldname like 'a%'

    Chris

    --
    Chris Hope
    The Electric Toolbox Ltd
    [url]http://www.electrictoolbox.com/[/url]
    Chris Hope Guest

  6. #5

    Default Re: MySQL by Letter

    this was very informative, however, I wonder if there's a way to find all the words that start with "any number or any special character" instead of a "letter". By example, your explanation would work in finding names of bands that start with "B", you click B and you get bands like "Blink 182" or "Bee Gees", but How can I find names that start with numbers, by clicking # and getting bands like "311", "1000 Maniacs".
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139