Update Mysqli Data

Asked

Viewed 441 times

-1

Staff need to make the BD update the following data of this wireframe via Mysqli, I would like some tips on how to proceed.inserir a descrição da imagem aqui

  • 2

    Better by the actual code referring to this sketch, instead of the image. The graphic representation has no relation to the functions of the mysqli, the yes code.

1 answer

0


<?php
$marca = trim($_POST["marca"]);
$tipo = trim($_POST["tipo"]);
$quantidade = trim($_POST["quantidade"]);

$atualiza = mysqli_query("UPDATE cigarros SET marca_cigarro = '$marca', tipo_cigarro = '$tipo', quantidade_cigarro = '$quantidade'");

if($atualiza){
echo 'Configurações salvas com sucesso!';
}else{
echo 'Erro ao salvar configurações, tente novamente';
}
?>

Remembering that the columns I used there in query are for you to have a basis. Change them to the real name of the columns that are in the MySQL.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.