Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// Connection
$dbuser = 'SYSDBA';
$dbpass = '*******';
$res = ibase_connect($db,$dbuser,$dbpass) or die("<br>" . ibase_errmsg());
$row = 1;
$handle = fopen("mysqltable_dump.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
// echo "<p> $num fields in line $row: <br /></p>\n";
for ($c=0; $c < $num; $c++) {
if ($data[$c]=="") {$data[$c]="null";}
// echo $data[$c] . "<br />\n";
$query="insert into firebird_table_name(firestcolumn_id,second_column,third_column) values (".$data[0].",".$data[1].','.$data[2].");";
echo "$query\n";
if (!$result) {
echo "Error. Can't insert the record with the query: $query!";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment