Notifications
Clear all

[Solved] Story texts and SQL modifying?

17 Posts
4 Users
0 Reactions
2,325 Views
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

URL to your eFiction: http://www.twiwrite.net
Version of eFiction: 3.5.2
Have you bridged eFiction, if so with what?: No
Version of PHP: 5.2.2
Version of MySQL: 5.0.77
Have you searched for your problem: Yes
If so, what terms did you try: missing story text, word count, cutting story off

State the nature of your problem: If a chapter is really long it cuts off. I have my settings to no max word limits. When you are posting everything shows up just fine, but after you post your story, it cuts half or more of the chapter off depending on how long it it. I found a few threads while searching and had a few questions because there seems to be different reasons why and different answers for each one.

This hasn't been an issue before. Before we opened the site up, I had to stories stored in folders instead of my SQL but when I changed it over the problem was solved. I know I've had some issues with my SQL lately, so I'm thinking this is linked since the issue just started.

First, I contacted my host, and they have cURL enabled. I hope that helps in some way with addressing this problem. (this was one of the solutions I found in the wiki and while searching) I was a little confused in the wording of some of the posts, and wondered if this was what I needed it to be. If not, my host can disable it, but is that a good idea if disabling is what I need to fix this? Again, I was confused on whether or not it was disabling or enabling that would help fix it.

Second, I found this thread https://efiction.org/forums/index.php?topic=5811.msg31550#msg31550 .
I am beyond skittish when it comes to messing with my SQL, I'm guessing because I don't really know much about it. So I'm wondering if maybe this isn't the problem and if it could fix it, but this whole thing confuses me. I use phpMyAdmin (or that's what my host uses). When I pull up the chapters table, and sort by story text like the thread said, I notice that under "type" it doesn't say "text" it says "varchar" instead. I don't know if that means anything or not, but thought I'd point that out.

Thirdly, again I don't know if this means anything or not, but under the "structure" tab in phpMyAdmin, the "Null" column has yes beside notes, story text and end notes. It also says "null" in the "default" column as well. In the other thread that I posted the link to, I did see where the setting should be set at "Not Null" and it is when I filter the chapters table to story text, but not under the main "structure" tab.

Lastly, past that, I don't understand what any of the rest of the directions mean. I'm not even sure if this is what can fix my problem, but in the other thread it seems to point out exactly what is going on with me. The publisher of the other thread never said whether they tried it or not and if it worked correctly if they did.

Can someone maybe explain if this sounds like it could work, and if so, how to do it exactly? My site is not as large as some of the other efiction sites. We have almost 1,400 members so that's big to me, but very small in the grand scheme of most sites. I don't know if site size has anything to do with it either, but thought I'd throw that in there too. I'm trying to give as much info, relevant or not, to help fix the problem.

Thanks for any help you might be able to give. I know I just threw out a lot of info, but I wanted to be thorough with my explanation.


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 03/01/2011 5:37 am
(@hobert)
Posts: 61
Trusted Member
 

What is the number in parentheses after VARCHAR?  That's usually the number of characters allowed in the field.  So a VARCHAR(255) would have a limit of 255 characters.

I, for one, use MEDIUMTEXT, which has a limit of roughly 16 million characters.  (The next lower one, TINYTEXT, is about 65,000, which was a little small to me)

Which works great, but then I start hitting other problems, like script timeouts (the script takes too long and hits a php time limit), size limits (the php POST size -- how much data PHP is transferring to MySQL -- is too small) and MYSQL crashes.  I've found an effective limit of about 100,000 words (give or take) for each chapter (remember, everything counts as characters, including HTML and formatting codes) given everything I can change.  Depending on your host and settings, your mileage will vary.

NULL (Yes/No) column simply tells MYSQL if a field can be empty ("Null") or not.  If you try and insert data and a NULL/NO field is empty, MySQL will return an error (which eFiction may or may not pass on to you).  A "null'" in the DEFAULT column means that if a new record is created, unless otherwise specified, this is what is inserted into the field (in the null case, it is blank).  I would leave these alone, as you mainly want to control things from the eFiction side.

I hope this helps explains some things you were wondering about and helps in your decision on what to do.  I would mainly suggest changing the storytext field type to MEDIUMTEXT and not using VARCHAR().


efiction - 3.5.3
MySql - 5.5.32
php - 5.5.22
Linex - Apache 2.2.17
Hosted by: Fatcow!
http://www.hobert.net/fic/

 
Posted : 03/01/2011 11:36 am
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

Hi, thanks for all the information. I really appreciate you taking the time to answer with all of this.

There isn't a number in parentheses besides VARCHAR. The column beside of it is Length Values and that box is blank. Not sure if you meant actually in the "type" box or the box beside it. Actually, all of the boxes are empty except "Type" and "Null". Does that mean anything?

So if I change it to MEDIUMTEXT, will the time outs and crashes occur more than likely? Or were you referring to the TINYTEXT? With all the issues I had with my SQL last week I'm beyond worried about even entering it, much less making changes, but if this will fix the posting issues then I'm more than willing to do it.

On a side note, I went in and added my longest chapter last night. Almost 11,000 words, and it posted just fine. Could a timeout be the reason behind this too and if so, is there anything I can do to change this or just tell my members to be speedy when uploading? lol

I will leave the "Null" column well alone. I just wasn't sure if that meant something from the other post. Thanks for explaining that to me as well.

I really appreciate all the help.


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 03/01/2011 12:52 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I noticed you said that cURL is on. cURL is notorious for cutting off chapter text when it finds certain words present (which varies by server). So it's possible it's that, if you've managed to post an even longer story than ones that are getting cut off. https://efiction.org/wiki/index.php5?title=Server_Errors_and_CURL (also http://dracoandginny.com/support/knowledgebase.php?article=18)

MySQL 5.0.3 and higher supports up to 65,535 characters with VARCHAR() - this includes the version you're at. However, the install script says that it's supposed to be set to TEXT, so if you're going to change it to anything I'd try that first. (MEDIUMTEXT is one of the TEXT types.)


 
Posted : 03/01/2011 4:33 pm
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

I decided to change VARCHAR to MEDIUMTEXT. When I changed it in the drop down menu to say MEDIUMTEXT or even just TEXT and hit save, it gave me a pop up message that said "Missing Value in the form". Obviously there is something else I'm supposed to be adding. Would I need to manually add something into the 'Length Values' box? Or is this something else? And what exactly would I need to put there? Am I manually telling it how many characters/words to set?

Also, is there a downfall for asking my host to disable cURL? It obviously serves some sort of purpose, and if this doesn't work and I try decide to have them disable it, are there any issues that come with that?

Thank you all so much for your help. I'm learning, slowly, but I want to make sure I have this site running at it's maximum potential, especially since we seem to be growing rather quickly. 


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 03/01/2011 6:03 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Hard to say. Can you screenshot it?


 
Posted : 03/01/2011 6:45 pm
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

Here's the SS of what I am looking at. It doesn't show the rest of the right side, but I can take another if you need to see that info. Just let me know.
Just something I thought I'd bring up. A friend of mine said something about an Apache server bug and cURL. Do you know of this and if it might be related. I contacted my host and they said that they can't apply the code she referred to. I know nothing about it and thought I'd ask.

Hopefully this will help.

Thank you so much for taking the time to help me.


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 03/01/2011 8:39 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Well, for one thing, the field name is missing. : )

Without knowing more about what your friend said, I have no idea if it could be the cause.


 
Posted : 03/01/2011 9:00 pm
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

Oh, maybe that's why. Um,  πŸ˜€ what would the field name be? I feel like this should be obvious. lol

Thanks!


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 03/01/2011 9:03 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Whatever the one you're modifying is called - storytext, right?


 
Posted : 04/01/2011 12:36 am
(@hobert)
Posts: 61
Trusted Member
 

Based on the screenshot, it looks like you are adding a new field, and not modifying an existing field.

Click the structure tab, find the line with storytest in the field, then go across and look for an EDIT or CHANGE option.  Clicking on this should show the form with all the existing information already filled in.  You can then change the dropdown box TYPE to MEDIUMTEXT (and delete the number in the length field, if any, or else get an error!!) and see if that helps your chapters cutting off.


(Your layout will vary based on the version of phpMyAdmin)

Another note, the next field LENGTH (when you are adding or editing a field) is for using if you need it.  For example, if setting VARCHAR(200), the field drop down would be set to VARCHAR, and then the length field would have 200 in it.  For fields without a (), like MEDIUMTEXT, the Length portion would be left empty.

One last note:  If this is happening more with one or two stories, and not as a whole, I've found that sometimes I've accidentally used a < or > in a story (or other odd character, or a bad html code) that causes problems.  You may want to examine the raw html at the point where the chapter cuts off to see if anything other than A-Z, a-z, 0-9 is going on.  This is especially easy when copying from Word or other word processing program.

And about that script timeout -- there is nothing you or your users can do to change the amount of time the script takes to upload the story.  If you are running up against that particular problem, you can only change the limit (in php.ini, if you are allowed to change it) or stay under it.

And, um, cUrl.  The problem is not so much turning it off and on for you specifically, it's that if your host does not use it, the word itself is typically banned (to prevent hacking attempts and such).  And they won't change that for just one person.


efiction - 3.5.3
MySql - 5.5.32
php - 5.5.22
Linex - Apache 2.2.17
Hosted by: Fatcow!
http://www.hobert.net/fic/

 
Posted : 04/01/2011 12:12 pm
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

πŸ˜€ I posted a chapter last night, which was at 14,000 words. It cut it off. I changed it from the structure console and posted again, it is now showing the whole chapter.

thank you Lyndsie and hobert for your amazing advice. It seems to be working so far. I've only tested the one chapter, but it's the longest one I have. I'm going to send out emails to everyone that had issues and have them repost, just to make sure it works on their end, but if it worked with mine, I'm sure it'll work on theirs as well. (fingers crossed)

Again, thank you so much, and hopefully this will be the end of this problem.


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 04/01/2011 12:35 pm
(@hobert)
Posts: 61
Trusted Member
 

Just because I am insanely curious, what was the value in VARCHAR() before you changed it?


efiction - 3.5.3
MySql - 5.5.32
php - 5.5.22
Linex - Apache 2.2.17
Hosted by: Fatcow!
http://www.hobert.net/fic/

 
Posted : 05/01/2011 2:42 pm
(@izdoodle)
Posts: 101
Estimable Member
Topic starter
 

There wasn't a value listed. Everything was blank.


http://www.twiwrite.net
Where Your Imagination Can Run Free
18+ TwiWrite Fan Fiction Archives.
efiction vs.3.5.2
SQL vs. 5.0.77
PHP vs. 5.2.2
Happily soaking up any and all php, tpl, and html knowledge I can.

 
Posted : 05/01/2011 2:45 pm
(@tammy)
Posts: 2577
Member Moderator
 

I'm curious how it got set to varchar to begin with. The storytext field at install is a text field.


 
Posted : 05/01/2011 7:44 pm
Page 1 / 2
Share: