Unknown system variable
Sorry if this is a simplistic question but I am new at this.
I have a PHP script that loops through an array and inserts in my MySQL DB the information. I get an intermittent "Unknown system variable" error. I say intermittent because as it loops through the data it is triggers at different points. I have searched forever and cannot find an answer - any help is appreciated.
Here is the code that is responsible for inserting into the DB
if ($result = $connection->query("INSERT INTO master_breweries(bdb_id, brewery_name, nameShortDisplay, description, website, established, isOrganic, `icon-image`, `medium-image`, `large-image`, `squareMedium`, `squareLarge`, status, createDate, updateDate) VALUES ('".$bdb_id."', '".$name."', '".$nameShortDisplay."', '".$description."', '".$website."', '".$established."', '".$isOrganic."', '".$icon."', '".$medium."', '".$large."', '".$squareMedium."', '".$squareLarge."', '".$status."', '".$createDate."', '".$updateDate."')")){
echo "$name - Success - $pc<br><br>";
}
else {
echo "$r - Error $name<br>";
if (!$connection->query("SET a=1")) {
printf("Errormessage: %s\n $pc<br><br>", $connection->error);
print_r($connection->error_list);
echo '<br>';
}
}
Would like to understand what this error is and how to fix.