Only half of article prints using LONGTEXT data type

Discussion in 'MySQL' started by Darden12, Dec 25, 2009.

  1. #1
    I have a longtext field called Article in which i store articles of various lengths. My longest article is 'just' a 100,000-word play, and yet when I try to echo it on my screen, only half of it shows up.

    Why is that? I thought the longtext data type took waaaay more data than that.

    Thanks,

    Brian
     
    Darden12, Dec 25, 2009 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    LONGTEXT has a maximum length of 4,294,967,295 or 4GB (232 – 1) characters which should be sufficient for your data.

    Make sure max_allowed_packet size (in my.cnf) is not affecting your saving and retrieval of data.
     
    mwasif, Dec 27, 2009 IP
  3. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    I have a shared hosting package. Where would I find my.cnf? I called my host, and they don't know -- said an engineer would get back to me in three days.
     
    Darden12, Dec 27, 2009 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    you can find it on /etc/my.cnf if you are on a linux server.
     
    mwasif, Dec 27, 2009 IP
  5. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #5
    I'm on UNIX shared hosting -- I'm not sure those files are available to me. I can't access them using FTP in TextWrangler, in any case. My main folder is htdocs, but i can't go below that.

    --could the problem with LONGTEXT be caused by excessive use of STR_REPLACE?

    For each character in the play, I have str_replace insert CSS based on the character name. The script to do that looks something like what follows. Could this script be overtaxing the server and causing it to cut out before echoing the entire article?
    
    		$find="#".$CLASSNAME."#";
    		$replace="<div class='insertcharnew' style='color:".$kolor1.";'>".$NOTES."<img src='".$BACKGROUNDIMAGE."' title='".$TITLETEXT."' class='insertcharnewimage' style='border-color:".$kolor1."' alt='".$TITLETEXT."'></div>";
    		$Article=str_replace($find,$replace,$Article);
    		
    PHP:
     
    Darden12, Dec 27, 2009 IP