Ver Mensaje Individual
  #7 (permalink)  
Antiguo 14/09/2009, 05:30
Avatar de hvpareja
hvpareja
 
Fecha de Ingreso: marzo-2007
Ubicación: En Vélez Málaga (Málaga)
Mensajes: 213
Antigüedad: 17 años, 2 meses
Puntos: 4
Respuesta: Problema: diferencia entre 0 y campo vacío

Código PHP:
$query "insert into tabla(cid,
                                                                  eid,
                                                                  gid,
                                                                  fid,
                                                                  ano,
                                                                  mes,
                                                                  dia,
                                                                  conc,
                                                                  fecha_intro,
                                                                  uid) 
                                                           values('1',
                                                                  '1',
                                                                  '1',
                                                                  '1',
                                                                  '1990',
                                                                  '4',
                                                                  '20',
                                                                  '1456',
                                                                  NOW(),
                                                                  '3')"

El valor conc es el que quiero diferenciar entre 0 y (Null).

El Create Table:

Cita:
CREATE TABLE `tabla` (
`coid` int(11) NOT NULL auto_increment,
`cid` int(11) NOT NULL,
`eid` int(11) NOT NULL COMMENT 'Especie',
`gid` int(11) NOT NULL COMMENT 'Genero',
`fid` int(11) NOT NULL COMMENT 'Familia',
`ano` int(4) NOT NULL,
`mes` int(2) NOT NULL,
`dia` int(2) NOT NULL,
`conc` int(11) default NULL COMMENT 'Si es nulo es que no hay datos para ese dia',
`fecha_intro` datetime NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`coid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
__________________
El mejor maestro es el eterno aprendiz.
http://hvpareja.wordpress.com/