I'm a newbie in PHP, so forgive me for a basic question.
In a While
statement, is there a way to know if a value in a row is equal to a value in the previous row?
I'm a newbie in PHP, so forgive me for a basic question.
In a While
statement, is there a way to know if a value in a row is equal to a value in the previous row?
Just store it:
$get = mysql_query("...");
$previous = '';
while ($row = mysql_fetch_assoc($get)) {
$current = $row['...'];
if ($current == $previous) {
// do stuff
}
$previous = $current;
}