ifis Posted February 7, 2008 Share Posted February 7, 2008 I have a simple query to a database that is supposed to post articles that people have submitted, the only problem is that there is a square after each period. (i.e. "drag?�� The student responded, �Induced drag increases when flaps are extended.�� This is not correct.� Induced") I have the field set to text. What am I doing wrong and how can I fix it? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/ Share on other sites More sharing options...
amites Posted February 7, 2008 Share Posted February 7, 2008 without seeing your code it's impossible to tell Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461337 Share on other sites More sharing options...
fenway Posted February 8, 2008 Share Posted February 8, 2008 Sounds like an linebreak issue Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461401 Share on other sites More sharing options...
ifis Posted February 8, 2008 Author Share Posted February 8, 2008 I think it is a double space problem. I notice if I manually delete the two spaces between characters it gets rid of the square. I am perplexed with why the squares show up, because if I look at the HTML of the posted page it does not include them. I guess my question is; how could I trim the extra spaces? I'm assuming I need some kind of replace function. I'm not sure how I can find 2 consecutive blanks then delete one of them though. Any ideas? I cut and past the data in the table from a HTML file, I'm going to try if I input the data through a form if it will have the same problem. My code is: $sql = "SELECT * FROM blog WHERE LoginName='$row[loginName]'" or die("cannot connect to table"); $result=mysql_query($sql); while($row = mysql_fetch_array($result)){ echo "<h1>$row[Title]</h1>"; echo "<p align='right'>Submitted: $row[Date]</p>"; echo "$row[Article]"; Thanks Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461409 Share on other sites More sharing options...
fenway Posted February 8, 2008 Share Posted February 8, 2008 It's some sort of non-ASCII character... where did this text come from? Rich text editor? Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461415 Share on other sites More sharing options...
ifis Posted February 8, 2008 Author Share Posted February 8, 2008 Basically, I took a document I had in word, then cut and pasted it into Dreamweaver and cleaned it up. I then took the html from Dreamweaver and put that into the field in my database. I have that field set up as 'text' and 'utf8_general_ci'. I don't know if that makes any difference, I usally use VARCHAR instead of TEXT in mysql databases. Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461418 Share on other sites More sharing options...
fenway Posted February 8, 2008 Share Posted February 8, 2008 Ah, Word...yup, plenty of garbage there. Quote Link to comment https://forums.phpfreaks.com/topic/89968-problem-with-formatting-output-for-mysql-text/#findComment-461728 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.