We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i need to add some column field in same file. can u tell how? cause in README.md i only found add column when create new file. thank you
The text was updated successfully, but these errors were encountered:
@ctw28 unfortunately there is currently no way to add a new column to an existing file. If you really need it, I can start developing this feature.
Sorry, something went wrong.
yes, i need it, and i would say thank you if you want to develop this feature. and i think, it will be great feature.
You can add a column to an existing table in Laravel before you set data
use Illuminate\Support\Facades\DB; DB::raw('ALTER TABLE '.$FullTableLocationPath.' ADD COLUMN new_column_name VARCHAR(255)');
$dbfTable = new WritableTable($FullTableLocationPath, [ 'editMode' => WritableTable::EDIT_MODE_CLONE, ]);
foreach ($query as $row) { $record = $dbfTable->appendRecord();
foreach ($row as $field => $value) { $column = strtolower($field); $record->set($column, $value); } $dbfTable->writeRecord()->save();
}
$dbfTable->close(); }
You can do it using PDO in laravel as well
$dsn = 'dbase://your_path/to/your_dbase_file'; $pdo = new PDO($dsn);
$sql = 'ALTER TABLE your_table_name ADD COLUMN new_column_name VARCHAR(255)'; $pdo->exec($sql);
.... Then do set data parts here..
No branches or pull requests
i need to add some column field in same file. can u tell how? cause in README.md i only found add column when create new file. thank you
The text was updated successfully, but these errors were encountered: