Comments (4)
echo $records->getString(ColumnName)
from php-xbase.
What error do you get? Do you know at which point it fails exactly? Sample code would help people help you.
from php-xbase.
it can read column count and column name, but it can not read while($record = $table->nextRecord()){}
i don't get error, but can not read record.
this is my code:
<?php
require 'DBFReader/XBase/Table.php';
require 'DBFReader/XBase/Column.php';
require 'DBFReader/XBase/Record.php';
require 'DBFReader/XBase/Memo.php';
require 'DBFReader/XBase/Exception/InvalidColumnException.php';
require 'DBFReader/XBase/Exception/TableException.php';
use XBase\Table;
$file = addslashes($_GET['file']);
/* buka koneksi database kita */
$user_name = "root";
$password = "";
$database = "db_sbh";
$host_name = "localhost";
$koneksi=mysqli_connect($host_name, $user_name, $password, $database);
//$disable_full_group = mysqli_query($koneksi, "SET sql_mode = ''");
$table = new Table("file/$file.dbf");
//$table = new Table("tes2.dbf");
$columns = $table->getColumns();
$jmlkolom = count($columns);
/*
echo "<table border=1>";
echo "<thead><tr>";
foreach ($columns as $column) {
echo "<td>".$column->name."</td>";//ambil nama semua kolom
}
echo "</tr></thead><tbody></table>";
*/
$row = 0;
while($record = $table->nextRecord()){
//$idprop = $record->prop;//ambil isi kolom id prop
$val = "";
for($i=0; $i<$jmlkolom; $i++){
if($i == $jmlkolom - 1){
$val .= "'$record[$i]'";
}else {
$val .= "'$record[$i]', ";
}
}
$sql = "INSERT INTO $file VALUES ($val)";
mysqli_query($koneksi, $sql);
echo "sql= ".$sql;
$row++;
}
echo $row;
?>
from php-xbase.
from php-xbase.
Related Issues (20)
- language not supported HOT 2
- 'tests' directory in reposit ( zip file) HOT 2
- HOW TO ADD NEW COLUMN HOT 2
- Compatible .dbf versions HOT 1
- Save inside a temp file HOT 8
- PHP Fatal error: Uncaught LogicException: Invalid number of bytes in binary string HOT 6
- Can't read or edit data from any dbf files, nor adding new records HOT 3
- TableException: Expected header terminator not present at position 6049 HOT 9
- Uncaught TypeError: str_pad() expects parameter 1 to be string, bool given HOT 1
- Invalid number of bytes in binary string. Expected: 123. Actual: 124 HOT 1
- .fpt file disappears when appending record to .dbf file HOT 5
- Creating Visual FoxPro files results in an incorrect Header Length HOT 1
- Fatal Error reading Foxpro dbf HOT 1
- Failed to open stream: Permission denied (disappearing .fpt that is not regenerated) HOT 1
- Memo is null
- Cannot use Y column type HOT 1
- Cannot read Floating Point vairable
- Encoding or Language ID HOT 1
- Float and Double Type is not support how need to create column ?
- writeRecord() changes all decimal digits in the record HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-xbase.