setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$runQuery = $file_db->query($query);
$buildArray = array();
foreach($runQuery as $row) :
array_push($buildArray, $row['name']);
endforeach;
$file_db = null;
if (in_array($check, $buildArray)) :
$found = '
'. $check . '
' . $check . ' was found in ' . $table . ' and is Good 2 Go!
';
elseif (!in_array($check, $buildArray)) :
$found = ''. $check . '
' . $check . ' was not found in ' . $table . ' and is being added now!
';
if ($type == "PRAGMA") :
$file_db = new PDO("sqlite:" . $dbfile);
$file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$count = $file_db->exec("ALTER TABLE `$table` ADD COLUMN `$check` TEXT");
$file_db = null;
endif;
endif;
echo $found;
}
?>
Organizr Upgrade