Incluir em uma tabela e exluir de outra.
Bom para incluir na outra tabela ta legal, mas agora para excluir to tendo problemas, ta retornando este erro:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'teste' at line 1
O Codigo para incluir em uma tabela e excluir de outra ta assim:
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];/ Deleta a informação da tabela estcomputador /$id = mysql_result($query, 0, "id");$deleteSQL = "DELETE FROM estcomputador WHERE id = ". $id;$Result = mysql_query($database_conn, $conn) or die(mysql_error());}if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO estcomputador_pendencia (patrimonio, perfil, memoria, proc, hd, responsavel, obs) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['patrimonio'], "text"), GetSQLValueString($HTTP_POST_VARS['perfil'], "text"), GetSQLValueString($HTTP_POST_VARS['memoria'], "text"), GetSQLValueString($HTTP_POST_VARS['proc'], "text"), GetSQLValueString($HTTP_POST_VARS['hd'], "text"), GetSQLValueString($HTTP_POST_VARS['responsavel'], "text"), GetSQLValueString($HTTP_POST_VARS['obs'], "text")); mysql_select_db($database_conn, $conn); $Result1 = mysql_query($insertSQL, $conn) or die(mysql_error()); $insertGoTo = "moverItem.OK.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo));}
e o form esta assim:
<form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <input type="hidden" name="patrimonio" value="<?php print mysql_result($query, 0, "patrimonio"); ?>"> <input type="hidden" name="perfil" value="<?php print mysql_result($query, 0, "perfil"); ?>"> <input type="hidden" name="memoria" value="<?php print mysql_result($query, 0, "memoria"); ?>"> <input type="hidden" name="proc" value="<?php print mysql_result($query, 0, "proc"); ?>"> <input type="hidden" name="hd" value="<?php print mysql_result($query, 0, "hd"); ?>"> <input type="hidden" name="MM_insert" value="form1"><input type="submit" value="Enviar Solicitação" class="box"> <input type="submit" value="Cancelar" onClick="java script:window.close()" class="box"></form>Discussão (1)
Carregando comentários...