473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Format output from mysql table

18
I have a an issue that's been bothering me. I have a a table with some data. This is my table format.

id
title
content ( where content is coming from a form). the content can be a long string
like that:

d0whgfhsd dfsadifufsadhosg fogaosdhfosadhg fsdojgofhvoashfg sfojgvhsofdhgvoasf

how do i display that content in a formated way. For example

d0whgfhsd dfsadifufsadhosg fogaosdhfosadhg
fsdojgofhvoashfg sfojgvhsofdhgvoasf

The reason why i need to do this is because if someone put a hurge article in the content, when i display the content on my page it's A LONG STRING OF CONTENT. I don't want that. it's messing up my webpage. Any help would be appreciated.
Nov 1 '07 #1
2 2197
just tell it to display in a <div> with a specified width... (and make sure to have a doctype :P)
Nov 2 '07 #2
Markus
6,050 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. //doctype n such up here..
  2.  
  3. <div style=\"width: <!-- set width //-->\">
  4. <?php
  5. // code for outputting stuff from table here
  6. ?>
  7. </div>
  8.  
Wasn't so hard was it :D
Nov 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Martin Foster | last post by:
Hi. I want to do something really simple. I want to be able to write a custom SQL query in a textbox on a webpage, submit it and then output to the webpage in the format of MySQL output i.e....
1
by: Neal | last post by:
I have a MySQL table with a datetime field that stamps the time the user submitted the form. It works and looks like this: $sql = "INSERT INTO table VALUES(....now())"; On another php page to...
3
by: Stefan van Roosmalen | last post by:
Hi there, I have developed several applications in Delphi. I used Paradox for my data storage. Now, I want to convert these databases to MySql. So that why I am looking for a way to convert the...
4
by: hph | last post by:
Okay, another trivial matter that I can't solve. I have a variable - $lastdate - that is the latest date any record in a MySQL database was updated. Its MySQL format is TIMESTAMP. If I say I...
9
by: Bob Sanderson | last post by:
I have a field in a database called DateRcvd. At present, it outputs in my report in the yyyy-mm-dd format. I would like it to display in the dd/mm/yy format. What is the easiest way to accomplish...
4
by: toffee | last post by:
Hi all, I created a little button which when clicked will run a query on mysql db and output the results as an excel spreadsheet. I do this by setting the header as application excel. All works...
2
by: daknightuk | last post by:
Hi people, I'm working on a project where I have a MYSQL database containing a database table which has opening hours of a load of businesses in it. Each business has 4 TIME fields for each day...
1
by: runsun | last post by:
I am new in PHP/Mysql. I want to input sth from website to mysql, then output the formatted data to .txt, and finally use Excel to open the .txt file. I believe there are better and simpler ways than...
8
by: yashiro | last post by:
Hello i Have a database in SQLserver. I am using php to connect to it and to retrieve data from that database. I have a table with a column (DATATIME) where i do : $result =...
22
by: sivadhanekula | last post by:
Hello Everyone A quick and direct question: I need a C/C++ program to extract the data from the database and the output should be in CSV "Comma Separated Value" format. Briefly: I will be given a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.