Error in SQL while updating through webpage


I'm trying to update my table named 'FA1' through a webpage.  The code used for this is:

foreach($columns as $item)  {   $sqlAtt = " update ". $class ." set ". $item ." = 'P' where `date` = '". $date ."' ";   $resultAtt = mysqli_query($GLOBALS['con']$sqlAtt);   if (!$resultAtt) {   printf("Error: %s " mysqli_error($GLOBALS['con']));   exit();   }  }   

$columns are the column names of the table. $class is the table name and $date has today's date.

While updating through SQL command executing space inside the database the result is