Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Wrapping Output

Posted on 2006-06-11
3
Medium Priority
?
282 Views
Last Modified: 2008-02-01
Hello,

I am working with a friend to make a small DB program.  I am the content writer, she is the programmer.  We've come up against a small program that we're hoping someone can help with.

The output of the data is in a kind of table, like a classified ads list.  The problem we are having is wraping the output.

If someone puts in a long unbroken string of text, it distorts the whole layout of the page.  Is there any special command of code we should be using on the cells or elsewher to force wrap the output from tables?

Put another way - when the mysql table is queried and displays its contents, is there any way to force that contents to always wrap to a certain width?

Thanks so much!

Ubee...
0
Comment
Question by:a466-ub52
3 Comments
 
LVL 30

Accepted Solution

by:
todd_farmer earned 1000 total points
ID: 16882495
Not in an easy-to-use built-in MySQL function, no - this type of data manipulation is best done at the application layer.  You can limit the number of characters returned by doing something like SUBSTR(columnname, 200).
0
 
LVL 19

Assisted Solution

by:Kim Ryan
Kim Ryan earned 1000 total points
ID: 16883007
Yes, you need to take the text output from the database and insert some non breaking spaces ( ) at the point of HTML creation. Alternatively you could filter the user input to prevent long strings from every being entered. This could easily be done with javascript.
0
 

Author Comment

by:a466-ub52
ID: 16883102
Thank you both very much!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question