$query = "SELECT id, noms FROM table ORDER BY id ASC";
$query2 = "UPDATE table SET `noms`=? WHERE `id`=?";
if ($stmt = $link->prepare($query)) {
$stmt2 = $link->prepare($query2);
$stmt2->bind_param('si',$noms,$id);
$stmt->execute();
mysqli_stmt_bind_result($stmt, $id, $noms);
while (mysqli_stmt_fetch($stmt)){
$noms = explode("|", $noms);
for($i=0;$i<count($noms);$i++){
$noms[$i]=$i.':'.$noms[$i];
}
$noms=implode('|',$noms);
$stmt2->execute();
}
}
This is what i want to do but there is a problem with collision between queries. How can i get rid of this?
this is simplified. php treatment is more complex. Not just explode/implode. Can't find a solution on google.