Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/02/2011, 07:42
Malekith
 
Fecha de Ingreso: abril-2006
Mensajes: 105
Antigüedad: 20 años, 5 meses
Puntos: 11
Respuesta: Problema con el if

Hola cannibales1974, a ver si te vale:

Código PHP:

$litros 
= ''; $fecha =''; $id=''; 


$id=$_POST["id"];
$fecha=$_POST["fecha"];
$litros=$_POST["litros"];

if(empty(
$fecha))
{

$fecha =date ("Y,n,j");

} else {

$fecha='$fecha';

};


$sql = "INSERT INTO litros ( nom, fecha, litros) VALUES ('$id', '$fecha', '$litros')";
$query = mysql_query ($sql, $link) or die ("Error guardando registro");