Jump to content
Fórum Script Brasil
  • 0

Maluquice MYSQL


Boa tarde, estou pegando uma variável e cadastrando em outra tabela mas o valor está entrando diferente, estou sem idéias.


$sql = "select * from resto where cod = $cod";
$resultado = mysqli_query($conectar,$sql) or die("Erro, Consulte o Administrador");
$arrayResultado = mysqli_fetch_assoc($resultado);//transforma a tabela que vem
$pad = $arrayResultado['nPad'];
echo var_dump($pad);

$sql1 = "INSERT INTO jacad(pad)
  VALUES ($pad);
$resultado1 = mysqli_query($conectar,$sql1) OR DIE ("Erro Consultar Administrador, erro cadastro !! " . mysqli_error() );
                                   //executa a query
    $sql3 = "select * from jacad";
$resultado3 = mysqli_query($conectar,$sql3) or die("Erro, Consulte o Administrador");
$arrayResultado3 = mysqli_fetch_assoc($resultado3);//transforma a tabela que vem
$pad3 = $arrayResultado3['pad'];
echo var_dump($pad3)




(Isso é o que me mostra) -> string(12) "PAD-001/2011" string(7) "-0.0005"

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

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.

Cloud Computing

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...