I have a while loop that returns X amount of data with the same value X amount of times before it changes to a different value.
// example 121, 121, 121, 121, 113, 113, 113, 113
each value is on its own line so a while loops puts them on the next is it possible to have an if that uses when the value changes ?
some thing like
while($row = $result->fetch_assoc()) {
if ($row["name"] == $row["name"]){
echo "<tr><td>".$row["name"]."</td><td>".$row["combi"]."</td>"
}else{
echo "<td>".$row["combi"]."</td></tr>"
}
}
$row["name"] == $row["name"]- this will always be true, I suppose. You can use a temporary variable to store previous name, but I wonder can't you do the same thing withGROUP BY-ing your query instead.group by nameclause within your query