データベースに保存されている値に基づいて、ページに1から5までの星を表示したいと思います。mySQLデータベースのデータをHTMLタグでエコーするPHPコードを書き込もうとしています。コードが正しいか間違っているかわかりません。私はそれをwhileループで実行し、多くのHTMLタグでデータを呼び出しています。コンピューターの画像を1stars.png、2stars.png、3stars.png、4stars.png、5stars.pngのフォルダー画像に保存しました。以下は私のコードです。
<?php
$query = mysql_query("select * from printers where printers_id='1';");
while ($row = mysql_fetch_array($query))
{
?>
<table width="281" border="0" style="margin-left:40px; margin-top:10px;" cellspacing="20">
<tr>
<td class="table_text_left"><figure>Value for money: <img src=images/"<?php echo $row['Value_For_Money'];?>".stars.png alt="5 stars" /></figure></td>
</tr>
</table>
<?php
}
?>