Insert an ARRAY from a CSV file into my Oracle DB using PHP

120
August 07, 2018, at 8:20 PM

I have a CSV file that will be populated with data each day.
It looks like this:

2 bits of data separated by a comma with a new row of data underneath it.

289,Data1.org.com:443  
268,Data2.org.com:443  
268,Data3.org.com:443   
268,Data4.org.com:443   
268,Data5.org.com:443   
8,Data6.org.com:443   
268,Data7.org.com:443    
268,Data8.org.com:443   
268,Data9.org.com:443    
602,Dta10.org.com:443     
569,Data11.org.com:443

I have created an array using this code:

$file = fopen('/var/www/sbt_websites/CertChecker/certoutput.csv', 'r');    
while (($line = fgetcsv($file)) !== FALSE) {   
//$line is an array of the csv elements
}

which looks like this:

 Array ( [0] => 289 [1] => Data1.org.com:443 ) Array ( [0] => 268 [1] => Data2.org.com:443 ) Array ( [0] => 268 [1] => Data3.org.com:443 ) Array ( [0] => 268 [1] => Data4.org.com:443 ) Array ( [0] => 268 [1] => Data5.org.com:443 ) Array ( [0] => 8 [1] => Data6.org.com:443 ) Array ( [0] => 268 [1] => Data7.org.com:443 ) Array ( [0] => 268 [1] => Data8.org.com:443 ) Array ( [0] => 268 [1] => Data9.org.com:443 ) Array ( [0] => 602 [1] => Data10.org.com:443 ) Array ( [0] => 569 [1] => Data11.org.com:443 )

I want to input this (along with with the sysdate of when I run the extract) into my table certtracker using PHP with the table headers DAYS APPLICATION LAST_RAN. Using PHP.

I have already built the table for the information to be stored.

Any help would be greatly appreciated.

Rent Charter Buses Company
READ ALSO
Return only unique values on form dropdown symfony 3.4

Return only unique values on form dropdown symfony 3.4

I've made a form that submits the parent organisations of an individual userThe database table the entity is linked to contains multiple entries for the organisation(as there are multiple users associated with each organisation) and I only want to return...

122
Anonymous function with dynamic number of arguments/parameters

Anonymous function with dynamic number of arguments/parameters

So, some time ago I build a parser for jQuery Query Builder plugin, which parses the formula into PHP code that returns some calculation based on added parameters, it could range from return $a + $b; to something like

150
Get all Laravel artisan commands for interface

Get all Laravel artisan commands for interface

When you use php artisan in the command line you get a list of all commandsAre there any opportunity to get all Laravel artisan commands programmatically? I need it for example to use it in a select field in the interface

155