Answer the question
In order to leave comments, you need to log in
What's wrong, everything works but there is a warning?
everything works correctly, the script is executed, but among other things it spams the warnings page
$otvet = mysql_query($sql);
if (mysql_num_rows($sql)>0){
while($row = mysql_fetch_assoc($otvet)){
echo "<div class=\"visualp\">
<p>{$row['num']}</p><h2>{$row['name']}</h2><div class=\"raterightside\"><i class=\"fa fa-arrow-down fa-lg\" aria-hidden=\"true\"></i><i class=\"fa fa-arrow-up fa-lg\" aria-hidden=\"true\"></i></div><div class=\"ratenum ";
$color = $row['rating'];
if ($color > 0) {
echo "green";
}
elseif ($color < 0) {
echo "red";
}
else {
echo "grey";
}
echo "\"><p>{$row['rating']}</p></div>
</div>";
}
}
else {
echo "<div class=\"visualp\">
<h2>+++ ДОБАВИТЬ +++</h2></div>";
}
Answer the question
In order to leave comments, you need to log in
If someone encounters this problem, everything is solved very simply:
if ($row = mysql_fetch_assoc($otvet)) {
while {}
}
else{}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question