The first TIMESTAMP field in a table automatically updates to the current date/time whenever you run an update.
You can stop it by setting it to itself -
$sql=mysql_query("UPDATE ads_main SET ads_active ='N', ads_expiry=ads_expiry WHERE ads_expiry < NOW()");
Though if you don't want the autoupdate the field should be changed to DATETIME field.
Hoe this helps 😉
EDIT:
too slow again :rolleyes: