php - enable button only if older than 90 days -


good day

i have delete button deletes entries on database, problem want disable button , enable if older 90 days.

i used code , it's working if it's not older 90 days still replies "successfully deleted" although not deleted , why thought easier disable delete button , enable if entry older 90 days

please assist

thanking you

$sql="delete client_post id = '$id' , date < date_sub(now(), interval 90 day)"; $result=mysql_query($sql);           if($result){          echo('entry '.$id.' deleted <br>'); } else{          echo('<br>failed delete'); }; 

change if statement to:

  if($result && mysql_affected_rows() > 0){ 

problem code checking if $result true, while $result identifier of mysql_query() results. should check how rows affected query.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -