Current Path : /data/web/virtuals/51568/virtual/www/knihy/lidi/ |
Current File : /data/web/virtuals/51568/virtual/www/knihy/lidi/lidi-uloz-DB.php |
<?php require_once('../../funkce/DbConnect.php'); if (isSet($_REQUEST["typ"])){$typ = $_REQUEST["typ"];} else {$typ = 'x';}; $call = mysqli_prepare($conn, 'CALL kn_lidi_deactivate (?)'); mysqli_stmt_bind_param($call, 's', $typ); mysqli_stmt_execute($call); $call = mysqli_prepare($conn, 'CALL kn_lidi_insert_update (?, ?, ?, ?, ?)'); if (($handle = fopen($_FILES['fileCSV']['tmp_name'], "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $pocetPoli = count($data); if ($data[0] == 'INTERN_KOD') {continue;} if ($pocetPoli == 3) { $trida = ''; $typ = 'u'; } else { $trida = $data[3]; $typ = 'z'; } mysqli_stmt_bind_param($call, 'sssss', $data[0], $data[1], $data[2], $typ, $trida); mysqli_stmt_execute($call); // mysqli_affected_rows($conn); echo mysqli_error($conn); } } fclose($handle); ?>