Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/09/2005, 05:26
Avatar de tycho
tycho
 
Fecha de Ingreso: marzo-2005
Ubicación: Linares
Mensajes: 48
Antigüedad: 19 años, 1 mes
Puntos: 0
Buenas, sir_bowen

no hace falta que hagas:
Cita:
if(strlen($_POST['vble1'])==0)
puedes hacer:
Código PHP:
if($_POST['vble1'] == ""
y si no quieres revisar cada variable, como comentas:

Cita:
if(strlen($_POST['vble1'])==0) {$vble2=NULL;}
mysql_query("INSERT INTO tabla1 (dato0,dato1) VALUES ('{$_POST['dato']}',$vble2)",$conexion);
Creo que sería así:
Código PHP:
if($_POST['vble1'])=="") {
       
$vble2=NULL;
}
$variable $_POST['dato'];
mysql_query("INSERT INTO tabla1 (dato0,dato1) VALUES ('$variable','$vble2')",$conexion); 
Saludos