StartDate & Days are integers so you should use the following format:
PHP Code:
Startdate = SQL_ReadResult(query, qcolStartdate );
You should use an <= condition in your query:
PHP Code:
SQL_QueryAndIgnore(sql, "DELETE FROM `%s` WHERE startdate <= %i", table, Startdate)
What I want to know is why you are reading all of the records in the table and then deleting 1 by one. See if this works:
PHP Code:
SQL_QueryAndIgnore(sql, "DELETE FROM `%s` WHERE (Startdate + (Days * 86400)) <= %d", table, CurrDate )
__________________