Welcome Guest, Not a member yet? Register   Sign In
Catch DB error
#5

Have you tried this way?

PHP Code:
if (($handle fopen('./Files/P.csv''r')) !== FALSE) {
 
   fread($handle3); // Discard the BOM
 
   $header fgetcsv($handle0$mySep); // First line is headers

 
   $i=0;

 
   while (($data fgetcsv($handle0$mySep)) !== FALSE) {
 
       try {
 
           $this->P_model->insert(array_combine($header$data));
 
       } catch (Exceptio $e) {
 
           $this->firephp->log('myDBerror et i'$myDBerror$i);
 
       }

 
       ++$i;
 
   }

Best regards,
José Postiga
Senior Backend Developer
Reply


Messages In This Thread
Catch DB error - by ComputingFroggy - 01-21-2016, 06:15 PM
RE: Catch DB error - by Diederik - 01-22-2016, 01:33 AM
RE: Catch DB error - by josepostiga - 01-22-2016, 02:40 AM
RE: Catch DB error - by ComputingFroggy - 01-22-2016, 05:40 AM
RE: Catch DB error - by josepostiga - 01-22-2016, 05:49 AM
RE: Catch DB error - by ComputingFroggy - 01-22-2016, 06:41 AM
RE: Catch DB error - by ComputingFroggy - 01-22-2016, 08:18 AM
RE: Catch DB error - by Shawn - 01-27-2016, 06:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB