Good day,
I am trying to validate data from a sqlserver database.
My approach is:
fields that I am checking are bit fields. Field names are the days of the week. Set to True or False in another program.
I basically want to check for the current day of the week and determine I the current day of the week matches the day and row from database and is true or false.
In my current code, below, the value of $Allowtoday changes back to 'no' after it was set true, correctly.
rgs
I am trying to validate data from a sqlserver database.
My approach is:
fields that I am checking are bit fields. Field names are the days of the week. Set to True or False in another program.
I basically want to check for the current day of the week and determine I the current day of the week matches the day and row from database and is true or false.
In my current code, below, the value of $Allowtoday changes back to 'no' after it was set true, correctly.
Code:
$Allowtoday = 'no';
$timestamp = time();
$whatdayisit = date('D', $timestamp);
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
switch ($whatdayisit) {
case "Mon";
if($row['Monday'] === true){
$cellno = $row['AuthorisedCellNo'];
$Allowtoday = 'yes';
break;
}
else
{
//echo '<dd><strong>Person not Authorised to Enter on a Monday! </strong></dt> ';
}
case "Tue";
etc....
if($Allowtoday = 'no') {
echo "blah, blah
exit;