PHP - Column 'fecha' cannot be null

 
Vista:

Column 'fecha' cannot be null

Publicado por sandra (60 intervenciones) el 05/12/2007 23:01:28
Hola, tengo un formulario para insertar registros.
Referencia
descripcion
fecha
foto

me gustaria saber como puedo hacer para que por ejemplo ,sino se mete el campo fecha por lo que sea, me deje insertar todos los demas campos.
Que tendria que poner? para que no sea obligatorio ese campo fecha.
gracias
ah este codigo no se si tendra algo que ver con mi pregunta gracias
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;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Column 'fecha' cannot be null

Publicado por Raul (27 intervenciones) el 07/12/2007 18:43:52
Tienes que tener en primer lugar en la base de datos permitido el valor nulo para ese campo y en segundo lugar comprobar que un ninguna parte del codigo controles que tenga q tener un valor antes de enviar el formulario.

Un saludo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar