Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/01/2008, 15:23
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Unknow columm 'codigo' in 'field' list

Alguien podria decirme el pq d este error???
Gracias!!!!

Unknow columm 'codigo' in 'field' list

Codigo
Código PHP:
<?php require_once('../../Connections/listproduc.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_insert"])) && ($_POST["MM_insert"] == "form1")) {

$ediciondir'../../images2/';  
$uploaddir=$ediciondir;
if (!
is_dir($ediciondir)) {     mkdir($uploaddir0777);    }
move_uploaded_file($_FILES['imagen']['tmp_name'], $uploaddir $_FILES['imagen']['name']);    
$filename $_FILES['imagen']['name'];

$insertSQL sprintf("INSERT INTO producto (PKIDCAT, nombre, codigo, descripcion, imagen) VALUES (%s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['PKIDCAT'], "int"),
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['codigo'], "text"),                       
                       
GetSQLValueString($_POST['descripcion'], "text"),
                       
GetSQLValueString($filename"text"));

  
mysql_select_db($database_listproduc$listproduc);
  
$Result1 mysql_query($insertSQL$listproduc) or die(mysql_error());

  
$insertGoTo "listproducto.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
 
header(sprintf("Location: %s"$insertGoTo));
}

mysql_select_db($database_listproduc$listproduc);
$query_Recordset1 "SELECT * FROM categoria";
$Recordset1 mysql_query($query_Recordset1$listproduc) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
Esta es la consulta el formulario esta en perfecto estado ...