<?php
require "ConnexionBDD.php";
session_start();
$db=new MyDB();

$cartes=$_POST['cartestables'];
$_SESSION['cartestables']=$cartes;
$idpartie = $_SESSION['idpartie'];

$tableau = $cartes;
for ($i = 0; $i <= 15; $i++) {
    $valcol1= substr($tableau[$i],-25,7);
    $valcol2= substr($tableau[$i],-14,7);
    $valcol3= substr($tableau[$i],-7);

    $update = $db->query('UPDATE partieCartes SET "colUn" = "'.$valcol1.'","colDeux"="'.$valcol2.'","colTrois"="'.$valcol3.'" where IdPartie="'.$idpartie.'" AND IdCarte="'.($i+1).'" ');
}

