//TODO: IF NULL don't '' $i == "1" ? $columns .= $k3 : ($columns .= ", " . $k3); $i == "1" ? $values .= "'" . $v3 . "'" : ($values .= ", '" . $v3 . "'"); $i++; } $sql = "INSERT into " . $table . " (" . $columns . ") VALUES (" . $values . ");"; echo "SQL: " . $sql; $columns = ""; $values = ""; } echo "<br>"; } } public function doImport() { $json = $this->getFile(); $decode = $this->decode($this->getFile()); $this->process($decode); } } /* $import = new import(); $import->file = "EssentialData.json"; $import->import(); */ $import = new import(); $import->file = "EssentialData.json"; $import->pattern_find = "si_"; $import->pattern_replace = "XID"; $import->replace();