$i=0;
$maxlen = 45;
while($row = mysqli_fetch_array($result)){
$i++;
$title = $row["title"];
if(mb_strlen($title, "UTF-8") > $maxlen)
$title = mb_substr($title, 0, $maxlen-3, "UTF-8")."...";
$score = $row["feedrate"];
if($score > 1) {
$badge = "badge-verygood";
$comment = "완전대박딜";
} else if($score > 0.7) {
$badge = "badge-good";
$comment = "사볼만한딜";
} else if($score > 0.5) {
$badge = "badge-notbad";
$comment = "중박같은딜";
} else {
$badge = "badge-soso";
$comment = "그저그런딜";
}
?>
}
mysqli_close($conn);
?>