Wednesday, 28 August 2013

How to style data from mysql database?

How to style data from mysql database?

i got this PHP code to display comments from database:
<?php
$con = mysql_connect("localhost","root","");
if (!$con){
die("cannot connect: " . mysql_error());
}
mysql_select_db("strek", $con);
$sql="SELECT * FROM comments";
$result=mysql_query($sql, $con);
while($row=mysql_fetch_array($result)){
$name=$row['name'];
$comment=$row['comment'];
echo $name. "<br>" .$comment;
echo"<br>";
}
?>
I'd like both name and comment to be aligned in the center and I'd like
name to be BOLD. Please help me how to do that.

No comments:

Post a Comment