删除数据库中少于一个数字的所有内容[关闭]

In PHP, I would like to run a query that would delete every row in a database that had the ID of less than a figure.

The context I want to use it in, is running a PHP CRON job every 24 hours that will delete all rows with values in the 'time' column that are LESS THAN time();

Putting it in to another context: I want to run a query that will delete every row that has an ID of ~10.

Thanks

I imagine you are not very familiar with SQL. This is a simple delete statement:

delete from t
    where id < 10;

This assumes that by "database", you really mean "table". It also makes some other assumptions about foreign key references in other tables. Because the question seems so basic, I am guessing these are not issues.

However, I would recommend that you study up a bit on databases if you are going to use them in your applications.