Click here to Skip to main content
15,918,596 members

Comments by Member 12989102 (Top 7 by date)

Member 12989102 30-Sep-17 18:38pm View    
the problem is not in the code (that works) but in the logic! If i use insert into the records are added but if i delete voluntarly an element it isn't deleted in the database. While if i use REPLACE, when the file is cleared, all records will be deleted in the database.
The problem it's simply: Is there a way to keep the items updated with P, obviating the problem of emptying?
Member 12989102 10-Sep-17 16:57pm View    
I know (not very well) how foreach work. But i don't know how can I get this:

match [2] [0] + match [3] [0] + match [4] [0]
[2] => Array ([0] => 9RUPISOLV 20BUST) in PRODUCT column +
[3] => Array ([0] => 00001) in QUANTITY column +
[4] => Array ([0] => 04) in TERMINAL column

After that, the cycle will have to continue
match [2] [1] + match [3] [1] + match [4] [1]
[2] => Array ([1] => 0CIBALGINE TWO FAST * 24CPR 200MG)) in PRODUCT column +
[3] => Array ([1] => 00002) in QUANTITY column +
[4] => Array ([1] => 01) in TERMINAL column

etc...
Member 12989102 10-Sep-17 15:50pm View    
I know how to use mysql but i don't know how use foreach (php) for my case!
If someone can do it in C# or VB.NET, for me it does the same!
I need that, when a file is edited, through regular expression:
#([0-9]{4,9}\s+[A-Z]{1}\s+([' . $specialChars . 'A-Z0-9 ]+)\s+([0-9]{3,7})n?\s+P\s+([0-9]+))# it search that i want and insert it into a mysql db
Member 12989102 10-Sep-17 15:46pm View    
Don't worry this service is for an internal web app, it's not public!
Why there aren't any solution?
Member 12989102 10-Sep-17 15:46pm View    
i posted on stackoverflow but nobody helped me
https://stackoverflow.com/questions/46143280/how-insert-array-in-a-mysql-db-foreach#comment79248309_46143280