hello guys,

how can i display the data from php mysql with text decoration for example underline or a dotted line css/html?


Member Avatar

Exactly as you've mentioned. Output the data into a tag (possibly with a suitable classname), e.g.

echo "<blockquote>{$data['quote']}</blockquote>";


echo "<span class='special'>{$data['special']}</span>";

THen if you've got CSS rules:

    text-decoration: none;
    border-bottom: 1px blue dotted;
    border: 1px single black;

Dear earlxph8, if you know how to use html this will be very easy for you.

In html file you directly write
<p>Sample test</p>

however in PHP, you have to echo the html:
<?php echo "<p>Sample test</p>";?>

When you echo a string, it will be treated as a html text, so all html tags will work when echoed.
What is even more important is that you can edit the style of the tags exactly like you do in html, taking the same example:


<p style="text-decoration:underline;">Sample Test</p>


<?php echo "<p style=\"text-decoration:underline;\">Sample Test</p>";?> *//the \ is to tell PHP that the string is not finished yet, so it will not end it.*


<?php echo '<p style="text-decoration:underline;">Sample Test</p>';?> /*//no need for the \*/

With MYSQL, you can store an HTML block with it's style as it is in the database. When you echo the data using php, it will be treated as HTML.

Good Luck, For any other information feel free to ask :)

I Agree with These guys , but my favouraite way to combine html + PHP is like that

<div><?php echo "This is new paragraph generated by PHP ?> </div>

This really Makes it easier for complex multiplication

this is very helpul guys. thanks.