sunny

OK guys, I resorted to I was comparing the two dates go get the interval in mont …

Thu 16 Nov, 2017 09:04 pm
OK guys, I resorted to I was comparing the two dates go get the interval in months. but I noticed that the UPDATE in database was inconsistent with the number of true rows.

what happened was that I wanted to display only rows due for notification by checking the notification date against expiration date. using normal comparison like

if(date_now >= notice_date & date_now < expiring_date){
show rows due for notification
}

this works just fine to display the rows. in my while loop statement.

but trying to update my record in database by change the NOTICE column to 1 from 0 is inconsistent. sometimes it will change rows that don't meet the criteria. and it's not changing all those that meets the criteria.

why I wanted to flag the notice column with one in the first place was for me to control the number of results let's say pagination.

my solution to it for now is that I push the row that meets the criteria in to an array. so can control my results.

thanks guys. never mind my English. Am just a newbie trying to learn from the best Brians. cheers!

Comments