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
Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe
Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.
pspell
using pspell, is it possible to get words that would be best in the current phrase?
For examp
pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main()
{
Specific name typed, specific image shown on html page
Hello,
Fairly new to PHP and was curious if someone might know how to solve a fairly simple r
Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now
Word filter problem
Hello,
im trying to make a filter for words inputted in to my website but i want to store the
finding key position of specified value in multi-dimensional array
Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{<
HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.
Create or replace package is ending ORA-21700
Database 9.2.0., patch 8 (9.2.0.8.0).
I trying run
create or replace package ....etc.