Dimwhit Posted April 15, 2008 Share Posted April 15, 2008 I have a database table that current has about a hundred entries. There are twenty or so fields in the table. I have one particular record that I just cannot figure out. One of the fields is a longtext field where a text narrative is placed. With this problem record, when I go in to edit it later, the narrative field is grayed out and won't let me edit it. I checked it today, and the db actually dropped the contents of that field so that it was empty! I was then able to re-past the narrative, but sure enough, it was uneditable when I went back in (I'm sure it will disappear eventually). So I'm at a loss. No other record is doing this. I thought that I maybe had a hidden character that was causing this. So I retyped the entire thing in a plain text editor. Didn't help. Then I tried just deleting the entire record and re-entering it (I'm coding all these pages with php, obviously--MySQL for the db). Same problem. But I've since entered other records and haven't had this problem. So I thought that maybe the colons in the narrative were the problem--don't know why they would be, but you never know. Nope, that wasn't it. Anyone have an idea of what I should try next? There's something about this particular record and it's narrative that my db just does not like, and I can't figure out what that is. Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/ Share on other sites More sharing options...
lalomarquez Posted April 15, 2008 Share Posted April 15, 2008 Maybe this would sound obvious for most but, have you tried to type the text directly in phpMyAdmin? I'm asking because some text editors add special hidden characters. Please disregard this comment if it's too stupid. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517765 Share on other sites More sharing options...
rhodesa Posted April 15, 2008 Share Posted April 15, 2008 I am curious as to what is doing: "the narrative field is grayed out and won't let me edit it"? phpMyAdmin? What are you using to edit the field basically? Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517767 Share on other sites More sharing options...
Dimwhit Posted April 15, 2008 Author Share Posted April 15, 2008 Maybe this would sound obvious for most but, have you tried to type the text directly in phpMyAdmin? I'm asking because some text editors add special hidden characters. Please disregard this comment if it's too stupid. Thanks. Not too stupid. I'll give that a shot. A pasted directly into phpMyAdmin, but I didn't try typing directly into it. Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517790 Share on other sites More sharing options...
Dimwhit Posted April 15, 2008 Author Share Posted April 15, 2008 I am curious as to what is doing: "the narrative field is grayed out and won't let me edit it"? phpMyAdmin? What are you using to edit the field basically? Sorry. It's the online form I use for entering new records. HTML/PHP form that inputs into the MySQL database. Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517791 Share on other sites More sharing options...
rhodesa Posted April 15, 2008 Share Posted April 15, 2008 I would guess there are some HTML characters in the textarea then...make sure you run the text through htmlspecialchars() before putting it inside the textarea tags: <?php $mytext; //The variable containing the text from the DB echo '<textarea name="foobar">'.htmlspecialchars($mytext).'</textarea>'; ?> If you show some of the code, I may be able to help further on it Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517798 Share on other sites More sharing options...
Dimwhit Posted April 15, 2008 Author Share Posted April 15, 2008 I would guess there are some HTML characters in the textarea then...make sure you run the text through htmlspecialchars() before putting it inside the textarea tags: OK, so I tried that, and it didn't work. Then as I was getting ready to copy the code to show you, I noticed something odd with it (how it escaped me until now I'll never know). Tried a fix, and it's working now! I'm not sure why it picked now (after more than a year) and only this record to show me it didn't like what I did, but I think it's fixed now. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517823 Share on other sites More sharing options...
kenrbnsn Posted April 15, 2008 Share Posted April 15, 2008 So, what was the problem & the fix? Ken Quote Link to comment https://forums.phpfreaks.com/topic/101223-solved-i-am-so-stumped-uneditable-field-in-my-db/#findComment-517846 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.