php code
<?php
function getReviews($con){
$sql = "SELECT * FROM review";
$result = mysql_query($sql,$con);
while ($row = mysql_fetch_array($result)) {
echo "<div class=' col-md-12 comment-box'>";
echo "<div class='left-comm col-md-2'>";
echo "<img class='img-responsive' src='images/article/avatar3.png'>";
echo "</div>";
echo "<div class='right-comm col-md-6'>";
echo "<p class='user-name'>".$row['email']."</p>";
echo for ($i=0; $i <$row['rating'] ; $i++) {
echo "*";
}"<br>";
echo $row['review']."<br>";
echo "</div>";
echo "</div><br>";
?>
我想在此功能中使用stars.显示费率值。
答案 0 :(得分:1)
变化:
echo for ($i=0; $i <$row['rating'] ; $i++) {
echo "*";
}"<br>";
为:
for ($i=0; $i <$row['rating'] ; $i++) {
echo "*";
}
echo "<br />";