SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Left ()

  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I noticed this function popup today, and really wanted to know what it could to.

    I've heard many people talk of it and find that it is used in many places.

    So I wasn wondering what it can do.

    Thanks so much...

    -Peter

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a MySQL function that returns the X number of characters in a specified character column:
    e.g. "SELECT LEFT( username, 5 ) FROM user;"

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a right() aswell?

    Peter

  4. #4
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think there is, yes. I know Sybase uses RIGHT (but not left, it uses substring( .. ) like PHP) but I'd expect MySQL to use both.

  5. #5
    SitePoint Member Victor's Avatar
    Join Date
    Dec 2000
    Location
    Georgia
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For other MySQL string functions, including RIGHT, check here -->
    http://www.mysql.com/doc/S/t/String_functions.html


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
  •