This topic is locked

Import Data

8/1/2013 5:08:16 AM
PHPRunner General questions
T
Tempus_Erus author

Hi,
A little open and complex I assume.......nor the less..........
I require to import data set. Not a problem. However, when importing I need validate a referance number and discount the record if exists.
Apprecaite a solution is beyond here but would appreciate a referance material or ideas I could refer to.
Thanks in advance.
A

Sergey Kornilov admin 8/1/2013

You can implement custom import validation using BeforeInsert event:

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

T
Tempus_Erus author 8/18/2013



You can implement custom import validation using BeforeInsert event:

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


Thanks Sergey, have played with the import and updatng table etc - all worked well.
However, (always a but!) I would like to validate the $rawvalues data as only containing numbers 0-9.
I check the data at the 'before insert stage'.....
if(($data["ref_number_in_db"] == $rawvalues["ref_mdb_in_csv_file"]) && (preg_match('/^[0-9]*$/', $rawvalues["ref_mdb_in_csv_file"]))) .....
the idea is to check for numbers only from the imported file from the start ^ to the end $.... (any referance with letters will be disregarded by the nature of the statement)
if the referance number is 1223456 we can validate the import successfully, howvwer if the referance number contains any letter the script does not work....
as always any input greatley appreciated.
Ade

Sergey Kornilov admin 8/19/2013

Not really sure I understand what exactly the question is here.