Jump to content
Fórum Script Brasil
  • 0

Update


Mário Filho

Question

galera o seguinte, eu fiz o seguinte código:

<?php

include "banco.php";

if(isset($_POST['suprab1_fe'], $_POST['alcoolb2_fe'],$_POST['gcb3_fe'], $_POST['suprab4_fe'], $_POST['gcb5_fe'], $_POST['gcb6_fe'], $_POST['gcb7_fe'], $_POST['gcb8_fe'], $_POST['b9d_fe'], $_POST['b10d_fe'], $_POST['b11d_fe'], $_POST['suprab1_ab'], $_POST['alcoolb2_ab'], $_POST['gcb3_ab'], $_POST['suprab4_ab'], $_POST['gcb5_ab'], $_POST['gcb6_ab'], $_POST['gcb7_ab'], $_POST['gcb8_ab'], $_POST['b9d_ab'], $_POST['b10d_ab'], $_POST['b11d_ab'])){

$suprab1_fe = $_POST['suprab1_fe'];

$alcoolb2_fe = $_POST['alcoolb2_fe'];

$gcb3_fe = $_POST['gcb3_fe'];

$suprab4_fe = $_POST['suprab4_fe'];

$gcb5_fe = $_POST['gcb5_fe'];

$gcb6_fe = $_POST['gcb6_fe'];

$gcb7_fe = $_POST['gcb7_fe'];

$gcb8_fe = $_POST['gcb8_fe'];

$b9d_fe = $_POST['b9d_fe'];

$b10d_fe = $_POST['b10d_fe'];

$b11d_fe = $_POST['b11d_fe'];

$suprab1_ab = $_POST['suprab1_ab'];

$alcoolb2_ab = $_POST['alcoolb2_ab'];

$gcb3_ab = $_POST['gcb3_ab'];

$suprab4_ab = $_POST['suprab4_ab'];

$gcb5_ab = $_POST['gcb5_ab'];

$gcb6_ab = $_POST['gcb6_ab'];

$gcb7_ab = $_POST['gcb7_ab'];

$gcb8_ab = $_POST['gcb8_ab'];

$b9d_ab = $_POST['b9d_ab'];

$b10d_ab = $_POST['b10d_ab'];

$b11d_ab = $_POST['b11d_ab'];

$sql = "UPDATE `canarinho`.`ab_fe` SET

suprab1_ab ='$suprab1_ab',

alcoolb2_ab ='$alcoolb2_ab',

gcb3_ab ='$gcb3_ab',

suprab4_ab ='$suprab4_ab',

gcb5_ab ='$gcb5_ab',

gcb6_ab ='$gcb6_ab',

gcb7_ab ='$gcb7_ab',

gcb8_ab ='$gcb8_ab',

b9d_ab ='$b9d_ab',

b10d_ab ='$b10d_ab',

b11d_ab ='$b11d_ab',

suprab1_fe ='$suprab1_fe',

alcoolb2_fe ='$alcoolb2_fe',

gcb3_fe ='$gcb3_fe',

suprab4_fe ='$suprab4_fe',

gcb5_fe ='$gcb5_fe',

gcb6_fe ='$gcb6_fe',

gcb7_fe ='$gcb7_fe',

gcb8_fe ='$gcb8_fe',

b9d_fe ='$b9d_fe',

b10d_fe ='$b10d_fe',

b11d_fe ='$b11d_fe',

data = NOW()

WHERE id='$id'";

$sql = mysql_query($sql);

if($sql){

echo "Atualizado... <script> window.location=\"busca/busca.php\" </script>";

} else {

echo 'Ops.. ocorreu algum erro: ('.mysql_errno().') – '.mysql_error();

}

} else {

echo "erro:".mysql_errno().') – '.mysql_error();

}

?>

e já testei toda as variáveis dando um echo pra ver se estavam vindo do formulario e td deu certo!

eu testei a query na parte de sql do phpmyadmin substituindo as variaveis por um número (exemplo : = '25') e rodou certo! Porém se eu acesso do navegador o formulário e substituo ele imprime "Atualizado" como está na If($sql) mas não altera realmente no banco de dados... alguém sabe o que esta acontecendo?

desde já agradeço.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...