This topic is locked

Import Excel

8/20/2020 3:39:52 AM
PHPRunner General questions
D
dirk author

In version 10.3 it is the case, if you do an import and the record already exists, it will adjust the other fields.
I would if the record exists that it doesn't make any adjustments and just continues the import.
Can anyone tell me how to fix this?
Thanks in advance

HJB 8/20/2020

Import page- View the pre-requisites !!! - https://xlinesoft.com/phprunner/docs/export_import_pages.htm
PHP Runner - Duplicate Records after import - Fixed - Video Tutorial
https://www.youtube.com/watch?v=E0rWkmaPtSs - Not a direct answer to your problem, yet provides deeper insights.

D
dirk author 8/20/2020



Import page- View the pre-requisites !!! - https://xlinesoft.com/phprunner/docs/export_import_pages.htm
PHP Runner - Duplicate Records after import - Fixed - Video Tutorial
https://www.youtube.com/watch?v=E0rWkmaPtSs - Not a direct answer to your problem, yet provides deeper insights.


This is not an answer to my question, because the explanation does not show how you can solve this.

Sergey Kornilov admin 8/20/2020

There is a BeforeInsert event that you can use to check if such record exists and prevent it from being imported:

https://xlinesoft.com/phprunner/docs/before_insert_record.htm

D
dirk author 8/20/2020



This is not an answer to my question, because the explanation does not show how you can solve this.


I give you self the code ....??



$rs = DB::Query("select * from database_bel where Code='$rawvalues[Code]'");

$data=$rs->fetchAssoc();

if($data)

{

return false ;

// if record exists do something

}

else

{

return true ;

// if dont exist do something else

}
HJB 8/20/2020



I give you self the code ....??



$rs = DB::Query("select * from database_bel where Code='$rawvalues[Code]'");

$data=$rs->fetchAssoc();

if($data)

{

return false ;

// if record exists do something

}

else

{

return true ;

// if dont exist do something else

}



Thx 4 info you found yourself what you need by means of a simple over-ride code. However, ADDING and UPDATING of imported records (assuming, some people fill Excel sheets and sent same over to you from time to time) is vital to at least me, so pleez accept my reliance on things I would prefer, simply trusting in (with earlier mentioned proper pre-requisites done) what the developers are telling me:
quote excerpt ex https://xlinesoft.com/phprunner/docs/export_import_pages.htm
PHPRunner adds new records or updates the existing ones when importing. During an import, PHPRunner tries to insert new records first. If the insert fails for any reason (for example, when there is a duplicate primary key), it then tries to locate and update the existing records.
unquote
Generally speaking, I'm populating databases via SQL dump imports and do NOT need Excel imports at all. Yet, in case, on a scenario where clients want to send updated Excel sheet based data from time to time, I would sit down on pre-requisites first.