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
21
Other forums
Serial number of exernal hard disk/Thumbdrive
Hi guys,
I am new tio java networking concepts.Please tel me how to get Serial
number of exernal
HELP with mysql_real_escape_string
I'm looking to remove apostrophes completely when someone enters lyrics but don't have a clue how to
Points for Wiki contribution
Hi everyone,
I want to know how long does it take for the moderator to award points for a
Error in query: Resource id #4??
hey guys, having a minor (i think) problem here that i havent been able to figure out. long story sh
C - Reading a file into a byte array
Hi,
I'm trying to read a file into a byte array in C. I have to use C as this is for a loadru
SOAP Issue
Hi,
I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi
Help with captcha script needed
Hello,
I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f
serializing objects - loses methods - the point being?
Hi
I know that serializing an object will lose the methods. But whats the point in that? What
PHP Mysql Staff Induction System
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi