Joey Riso - 2016-04-15 17:55:18
I had a piece of code which was using a Prepared Statement to return a result set of a few hundred rows ($queryGetFinancials).
One of the columns in the returned set was assigned to the variable $status.
This block of code followed:
while ($queryGetFinancials->fetch()) {
$status = strtolower($status);
switch ($status) {
case 'bid':
$n = $b++;
break;
case 'in-work':
$n = $i++;
break;
case 'active':
$n = $a++;
break;
}
...do more processing
The code worked fine for many months, then, yesterday, for no reason that I can understand, the section suddenly failed, with the $status variable being assigned to the value of the first row returned, and never updating.
My questions are:
1) Is my initial code a misuse of the reassignment
$status = strtolower($status;
2) What could cause the code to change its operation?
Thanks --