I am able to print all values from a table but I would just like to learn how to print next to it when it matches the value from the URL variable &year=
$setYear = $_GET['year'];
print $setYear . "<br><br>";
$Success = "YES";
while ($row = $resultselect->fetch_assoc()) {
echo $row["Orders_Year"] . " <br>";
// Should I do a for loop?
}
Should I do for a loop to evaluate each record? I have been trying different things to learn but I seem to be stuck learning this.
>Solution :
Assuming the date fields are the same format all you need is a simple test to see if the dates are the same
$Success = 'YES';
while ($row = $resultselect->fetch_assoc()) {
echo $row['Orders_Year'];
if ( $_GET['year'] == $row['Orders_Year'] ) {
echo ' ' . $Success;
}
echo '<br>';
}