www.webdeveloper.com
Results 1 to 4 of 4

Thread: Upper case formatting

  1. #1
    Join Date
    Apr 2009
    Location
    India
    Posts
    15

    Upper case formatting

    Database: MySql
    I have group of words stored in a table single attribute
    I want to make first letter of each word uppercase

    Attribute => NAME
    Value => mohan kumar

    I want to format the value and fetch it as "Mohan Kumar"
    Niote: value stored in single attribute

    Any one can help me?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,235
    If by any chance this is part of a PHP script, you could do it very easily in the application code via the ucwords() function.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Apr 2009
    Location
    India
    Posts
    15
    NogDog, thanks for your reply.

    Obviously it is easy by using PHP or any server side scripting language.
    But i expect the functionality in MySQl

  4. #4
    Join Date
    Aug 2007
    Location
    Leeds, Yorkshire, England
    Posts
    387
    It's probably better to store the name as you want it in the database initially rather than performing an operation on it every time you retreive it.

    This will do the first letter of a column value, but for you you'd need to store first name in one column and last name in the other.
    SELECT CONCAT(UCASE(MID(name,1,1)),MID(name,2)) AS name FROM names;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles