problem when doing update php data and show

-1

I have a page where I can add and delete data in DB Using update.

Now I get a problem because when I update a page the dates all I ask go from null to 0000-00-00. and I using this code:

if(!empty($exibe["MedicaValidade16"])) {

It will show me all the data because they have been 0000-00-00 . How to work around this?

    
asked by anonymous 25.07.2014 / 13:05

1 answer

0

This, in my opinion, is being written to the database in this way 0000-00-00 and not null, perhaps its table field is like not null so recorded in that format.

From two 1's, or you change your table, if that's the case, or test the return on your application like this:

if(!empty($exibe["MedicaValidade16"]) || $exibe["MedicaValidade16"] != '0000-00-00') {

I hope I have helped!

    
25.07.2014 / 13:38