Making PHP output Bold
Solution 1:
Simply add HTML strong tags into your print, removing on lines where it is not necessary.
while($row = mysql_fetch_array($oPlayerInfo))
{
Print "<strong>".$row['FirstName']." ".$row['LastName']."</strong><br>";
Print "<strong>Position: ".$row['Position']."</strong><br>";
Print "<strong>Height: ".$row['Height']."</strong><br>";
Print "<strong>Weight: ".$row['Weight']."</strong><br>";
Print "<strong>Birthdate: ".$row['DOB']."</strong><br>";
Print "<strong>CNGHL Team: ".$row['CNGHLRights']."</strong><br>";
Print "<strong>NHL Team: ".$row['Team']."</strong><br>";
Print "<strong>Draft Year: ".$row['CNDraftYR']."</strong><br>";
Print "<strong>Draft Position: ".$row['CNDraftPOS']."</strong><br>";
Print "<strong>Drafted By: ".$row['CNDraftTEAM']."</strong><br>";
Print "<img src=\"http://www.cnghl.biz/cnghldb/images/".$iPlayerID.".jpg\">";
}
With this
Print "<strong>Height: ".$row['Height']."</strong><br>";
The whole line will be bold. With the one below
Print "<strong>Height:</strong> ".$row['Height']."<br>";
Only the label will be bold.
Solution 2:
Try this to make firstname and lastname bold.
Print "<b>".$row['FirstName']." ".$row['LastName']."</b><br>"; //<b> and </b>
Solution 3:
Try like this...
<?php
while($row = mysql_fetch_array($oPlayerInfo))
{
echo "<strong>"; // <---- Added here
echo "".$row['FirstName']." ".$row['LastName']."<br>";
echo "Position: ".$row['Position']."<br>";
echo "Height: ".$row['Height']."<br>";
echo "Weight: ".$row['Weight']."<br>";
echo "Birthdate: ".$row['DOB']."<br>";
echo "CNGHL Team: ".$row['CNGHLRights']."<br>";
echo "NHL Team: ".$row['Team']."<br>";
echo "Draft Year: ".$row['CNDraftYR']."<br>";
echo "Draft Position: ".$row['CNDraftPOS']."<br>";
echo "Drafted By: ".$row['CNDraftTEAM']."<br>";
echo "</strong>"; // <-----Closing here
echo "<img src=\"http://www.cnghl.biz/cnghldb/images/".$iPlayerID.".jpg\">";
}
Solution 4:
Well, I think that putting such an operation in an HTML file, it is a bad practice. I recommend using the MVC pattern.
Something like this...
Controller
<?php
$rows = array();
while($row = mysql_fetch_array($oPlayerInfo))
$rows[] = $row;
return $rows;
?>
View
<html>
<head><title>Test</title></head>
<body>
<?php foreach($rows as $row): ?>
<section>
<div>
<label>$row['FirstName']." ".$row['LastName']</label>
</div>
<div>
<label>Position: ".$row['Position']</label>
</div>
<div>
<label>"Height: ".$row['Height']</label>
</div>
<div>
<label>Weight: ".$row['Weight']</label>
</div>
<div>
<label>Birthdate: ".$row['DOB']</label>
</div>
<div>
<label>CNGHL Team: ".$row['CNGHLRights']</label>
</div>
<div>
<label>NHL Team: ".$row['Team']</label>
</div>
<div>
<label>Draft Year: ".$row['CNDraftYR']</label>
</div>
<div>
<label>Draft Position: ".$row['CNDraftPOS']</label>
</div>
<div>
<label>Drafted By: ".$row['CNDraftTEAM']</label>
</div>
<div>
<img src="http://www.cnghl.biz/cnghldb/images/".$iPlayerID.".jpg">
</div>
</section>
<?php endforeach; ?>
</body>
</html>