I became interested, but in your code I do not find the file name to import and work with the file.What is important - to use php-funсtion should be an unprivileged user.Janusz wrote:the current form Primary key can be easilly sent from JS to PHP and used in mysql
so you collect data from excel; adding the current record Primary key, inserting data to table and thats alland for adding subform unique id use nuID(); (for more records - in the loop - every line - has to have new nuID generated)Code: Select all
//get id of the current main record (JS) var id=nuGetProperty('record_id'); // prepare to be available in php (JS) nuSetProperty('CON_PART_ID', id); //recover and use in PHP (PHP) $pid=('#CON_PART_ID#'); $uid=nuID(); $x="INSERT INTO connection (connection_id,con_part,con_rap) VALUES ('$uid','$pid','$rap_id')";
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Is it possible to import data into a subform from a file?
-
- Posts: 377
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Is it possible to import data into a subform from a file
-
- nuBuilder Team
- Posts: 508
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 11 times
- Been thanked: 18 times
Re: Is it possible to import data into a subform from a file
i do not use in my application php data import from the file so do not have ready example to share - but normally within php it should be easy to read data from external files - depandind on data fromat etc.
just few examples:
https://phppot.com/php/import-excel-fil ... 0by%20row.
https://phpenthusiast.com/blog/parse-csv-with-php
just few examples:
https://phppot.com/php/import-excel-fil ... 0by%20row.
https://phpenthusiast.com/blog/parse-csv-with-php
If you like nuBuilder, please leave a review on SourceForge
-
- Posts: 377
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Is it possible to import data into a subform from a file
Thanks for the valuable advice. I had to be perverted, because I don’t have all the rights to the resources of a mixed (Linux-windows) local area network. I used php, smbclient, phpExcel to write directly to the mysql database according to your advice. Of course, this is unsafe, but it eliminates unforeseen errors from the database users.Janusz wrote:i do not use in my application php data import from the file so do not have ready example to share - but normally within php it should be easy to read data from external files - depandind on data fromat etc.