Formatting text retrieved from MySql db with php
Hi. I'm working on Dreamweaver CS3 and using Mac OS X 10.4.11 (Tiger) with Safari 4.1.3 web browser
I'd like to know how to format data retrieved from a MySql Data base using PHP.
For Example, in a Basic Contact form, when i want to view the messages, i've used this code :
===================================================
<?PHP
mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("contact") or die(mysql_error());
$data = mysql_query("SELECT * FROM client")
or die(mysql_error());
$info = mysql_fetch_array( $data );
?>
<?php
Print "<table border cellpadding=3 align='center' bgcolor='#FFFFFF'>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<th bgcolor='#0066FF'><font color='#FFFFFF'>Full Name:</font></th> <td>".$info['fullname'] . "</td> ";
Print "<th>eMail :</th> <td>".$info['<br />email'] . "</td> ";
Print "<th>Phone:</th> <td>".$info['phone'] . "</td> ";
Print "<th>Subject:</th> <td>".$info['subject'] . "</td> ";
Print "<th>Message:</th> <td>".$info['message'] . "</td></tr>";
}
Print "</table>";
?>
===================================================
of course, it works. And now, i want to formate the text on the retrieving page : set a customized font, color, size and so forth. Because, when the messages are printed in an array, they look like this :
=========================================================
Full Name: myname eMail :my email Phone: 123 Subject: the subject Message: text
Full Name: myname 2 eMail :my email2 Phone: 1234 Subject: the subject Message: text
=========================================================
So, it is not nice any more. And also the long is the message, is the width the page will take. And some time it larger the page width and user have to scroll the web browser to left and right in order to see the rest of the message.
So, I'd like to know how can i customize the view of messages retrieved from my MySql Data Base, either using PHP, HTML or CSS, if possible.
Thank you for all