php4dbf - CSV-import
php4dbf - CSV-import
Hello friends,
Sometimes it is also necessary to access DBF files from PHP. Therefore, I created a library.
Here is an example today of how I import a CSV file into a DBF file.
The program is designed to streamline the process of transferring structured data (like customer information) from a CSV file into a DBF database file. It provides a user-friendly interface for mapping paths and verifying data before the import.
Best regards,
Otto
Sometimes it is also necessary to access DBF files from PHP. Therefore, I created a library.
Here is an example today of how I import a CSV file into a DBF file.
The program is designed to streamline the process of transferring structured data (like customer information) from a CSV file into a DBF database file. It provides a user-friendly interface for mapping paths and verifying data before the import.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: php4dbf - CSV-import
Is this a stand alone project ?
If you use a local path... it will also work ?
If you use a local path... it will also work ?
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: php4dbf - CSV-import
Hello Marc,
Do you have access to a PHP server where you can upload a file and then execute it?
It also works on localhost if PHP is installed.
If so, I can email you the project.
It's very simple:
copy importcsv.php and php4dbf.
You would then need to create the subdirectory "import" for your CSV and the "data" directory for your DBF.
Best regards,
Otto
Do you have access to a PHP server where you can upload a file and then execute it?
It also works on localhost if PHP is installed.
If so, I can email you the project.
It's very simple:
copy importcsv.php and php4dbf.
You would then need to create the subdirectory "import" for your CSV and the "data" directory for your DBF.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: php4dbf - CSV-import
I have the options yes.
I can upload and try.
Interested because I use a lot of csv (now in combination with exel and FW function) to read data and convert into a dbf for processing.
I can upload and try.
Interested because I use a lot of csv (now in combination with exel and FW function) to read data and convert into a dbf for processing.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: php4dbf - CSV-import
Hello Marc,
I have sent the link to the program for importing CSV into DBF files via email.
Best regards,
Otto
I have sent the link to the program for importing CSV into DBF files via email.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: php4dbf - CSV-import
Extended version of your program that allows assigning either a CSV field or a fixed text for each DBF field. If a fixed text is entered, it will be used; otherwise, the field will be filled from the CSV file.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: php4dbf - CSV-import
I sent a error that I get by mail in order to be shure it is not at my side .... and the FW group get confused.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: php4dbf - CSV-import
Hello Marc,
I am using PHP version 8.3.9.
In PHP versions prior to 8.0, it is not allowed to set a default value other than NULL for parameters with type hints. This leads to the mentioned error.
I think that's the problem.
Best regards,
Otto
I am using PHP version 8.3.9.
In PHP versions prior to 8.0, it is not allowed to set a default value other than NULL for parameters with type hints. This leads to the mentioned error.
I think that's the problem.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: php4dbf - CSV-import
Changed to 8.40. Have to look where to put the correct path, but I see the program
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
Re: php4dbf - CSV-import
Good to hear. Files outside the directory C:\htdocs are blocked. This is a security measure to prevent someone from accessing files outside the webserver. However, you can change this setting if you want and if it's your system.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: php4dbf - CSV-import
Marc, The program needs the correct DOS path.
Where did you host your web server? On your PC or with a hosting company?
Maybe I should implement a file upload for the DBF file in case there is no direct access to the web server.
Best regards,
Otto
Where did you host your web server? On your PC or with a hosting company?
Maybe I should implement a file upload for the DBF file in case there is no direct access to the web server.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************