Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Simplismente isso, ele retorna a mensagem que os dados foram atualizados, mas não muda nada do banco, não retorna erro algum, alguem ae pode me ajudar??
ahh detalhe, eu peguei isso já feito, só estou fazendo algumas mudanças, como percebe-se esse código é o que o dreamweaver gera qdo se monta algum sistema, por isso não entendo lhufas.
<?php require_once('Connections/fornecedor.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE dados_fornecedor SET nome='$nome', contato='$contato', email='$email', contato2='$contato2', email2='$email2', endereco='$endereco', telefone='$telefone', municipio='$municipio', estado='$estado', cgc='$cgc', inscricao_estadual='$inscricao_estadual', inscricao_municipal='$inscricao_municipal', praca_pagamento='$praca_pagamento', end_protocolo='$end_protocolo', banco='$banco', banco_num='$banco_num', banco_ag='$banco_ag', banco_cc='$banco_cc' WHERE cd_fornecedor='$cd_fornecedor'",
GetSQLValueString($_POST['nome'], "text"),
GetSQLValueString($_POST['contato'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['contato2'], "text"),
GetSQLValueString($_POST['email2'], "text"),
GetSQLValueString($_POST['endereco'], "text"),
GetSQLValueString($_POST['telefone'], "text"),
GetSQLValueString($_POST['municipio'], "text"),
GetSQLValueString($_POST['estado'], "text"),
GetSQLValueString($_POST['cgc'], "text"),
GetSQLValueString($_POST['estadual'], "text"),
GetSQLValueString($_POST['municipal'], "text"),
GetSQLValueString($_POST['praca'], "text"),
GetSQLValueString($_POST['end_protocolo'], "text"),
GetSQLValueString($_POST['banco'], "text"),
GetSQLValueString($_POST['banco_num'], "text"),
GetSQLValueString($_POST['banco_ag'], "text"),
GetSQLValueString($_POST['banco_cc'], "text"));
mysql_select_db($database_fornecedor, $fornecedor);
$Result1 = mysql_query($updateSQL, $fornecedor) or die(mysql_error());
$updateGoTo = "index_sucesso.html";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_rs_fornecedor = "1";
if (isset($_GET['codigo'])) {
$colname_rs_fornecedor = (get_magic_quotes_gpc()) ? $_GET['codigo'] : addslashes($_GET['codigo']);
}
mysql_select_db($database_fornecedor, $fornecedor);
$query_rs_fornecedor = sprintf("SELECT * FROM dados_fornecedor WHERE cd_fornecedor = %s", $colname_rs_fornecedor);
$rs_fornecedor = mysql_query($query_rs_fornecedor, $fornecedor) or die(mysql_error());
$row_rs_fornecedor = mysql_fetch_assoc($rs_fornecedor);
$totalRows_rs_fornecedor = mysql_num_rows($rs_fornecedor);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Gerenciamento de Dados Creative House</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="protocolo.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<form action="<?php echo $editFormAction; ?>" name="form1" method="POST">
<table width="560" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="30" colspan="2"> </td>
</tr>
<tr>
<td width="275" height="52"><div align="center"><a href="[http://servidor:8000/home.html">Carregando comentários...