formating when pulling data from a mysql database


Posted on 16th Feb 2014 07:03 pm by admin

Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.

I have a test web page www.aandstech.com.au/test.php

Test.php pulls its content from a my sql table.
This works fine.

When I pull down the info without
Code: [Select]<pre>code to retrieve data from mysql database</pre>tags I loose all my formating ie carraige returns. However the justify works fine.

When I use my Code: [Select] <pre> tages to retrieve data from mysql database the carrige returns are fine however the text goes right accross the entire page and not within its div.

I have made some headway into resolving this issue by using Code: [Select]<pre width="80"></pre>However this fix looks fine in firefox 3 but has absoultley no effect in ie6 through to 8.0.

Anyway heres a snippet of my code any help would be greatley appreciated.
Code: [Select][color=red]<div class="body">

<p> <?php
$db =mysql_connect("localhost", "******", "*******");
mysql_select_db("*****_*****",$db);
$result = mysql_query("SELECT * FROM ***** WHERE id = 1",$db);

while($myrow = mysql_fetch_array($result))
{
echo "<pre width='80'>";
echo "<font face='Lucida Sans Unicode' size=2>";
echo $myrow["data"];
echo "</font>";
echo "</pre>";

}

?>
</p>

</div>[/color]
Another thing is that Im using css and any text pulled from a table doesn't use the css thats why I had to put the fonts in.

No comments posted yet

Your Answer:

Login to answer
338 Like 21 Dislike
Previous forums Next forums
Other forums

BI in Upstream Production operations
Appreciate if you can assist in the following areas:
1) Examples of life before and after BI i

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to a

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

Streaming local file from PHP while it’s been written to by a CURL process
I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a

What is SAP Avatar ?
Hi All,

This G.Satish , my boss asked me to explore on SAP Avatar. I searced in internet

creating a 1 to 100 in a table
hi guys I am a newb in php need some help.

I have a table with 1 column and 100 rows and in

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

Is it possible to put an entire 500-page book in a database with PHP?
I am working on an intranet and I was wondering if its possible to code php with mysql to enter a fu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash