Read and Sort before to save records

Hi everyone!!
I have this:
if(file_exists("filename.csv")) {

    $registro = fopen("filename.csv", "r");
    $BD = new ConexionDB();
    while (($data = fgetcsv($registro, 200, ",")) !== FALSE) {
        $sth = $BD->prepare("INSERT INTO table_temp (codigo, name) VALUES (:codigo, :name)");
        $codigo = $data[0];
        $name   = $data[1];
        $sth->bindParam(':codigo', $codigo);
        $sth->bindParam(':name', $name);
        $sth->execute();
    }
}
PHP:
The source data...

Read and Sort before to save records

from PHP http://ift.tt/1sHdJPd
via IFTTT
Previous
Next Post »
Thanks for your comment