SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot dcgamers's Avatar
    Join Date
    Dec 2005
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WHERE LEFT is a number

    I have the following code:
    PHP Code:
    mysql_query("SELECT * FROM example WHERE LEFT(name, 1) = 'a'"); 
    This displays each record in alphabetic order. But Now I need all records that start with a number to be displayed. How can I do that?

  2. #2
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    mysql_query("SELECT * FROM example WHERE LEFT(name, 1) <= '9'")
    should work.

    Regards,

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)


Bookmarks

Posting Permissions

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