SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What data type to use to store lyrics of song

    Hi in a mysql table what datatype should I use to store an entire lyrics of a song? Thanks

    Iago

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    text. the only other I'd recommend is varchar, but it only holds up to 255 chars.

    Aaron
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Zealot
    Join Date
    Mar 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    Thanks for your reply. I have this table to setup

    CREATE TABLE songs (
    id int(3) unsigned NOT NULL auto_increment,
    song_name varchar(100) NOT NULL,
    song_id int(3) DEFAULT '0' NOT NULL,
    PRIMARY KEY (id),
    KEY song_name (song_name));


    If I replace varchar(100) above with TEXT , then the following error message shows up:

    BLOB column 'song_name' used in key specification without a key length

    The table songs is not formed. What's the fix then? Thanks again!

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might want to look at the explanation Dr. Pep gives in this thread. It basically covers the same subjects, just some other field names .

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks so much for locating a similar thread!

    So what is basically being said is that I change


    KEY song_name (song_name));

    To

    KEY song_name (song_name(50));

  6. #6
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I guess so. I am not too familiar on the subject of keys. Is this used when doing a search in the database, to limit the amount of characters that appear in the result?

  7. #7
    SitePoint Zealot
    Join Date
    Mar 2002
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Mark yes that's what I think is being said in that thread. I will check out the correction tomorrow! thanks again.


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
  •