Sunday, 15 September 2013

Php MySQL - Delete all rows by limit

Php MySQL - Delete all rows by limit

I want to delete all rows expect the 5 first rows.
/*example of the $count is equal to 5 */
$count=$xml->table->records->attributes();
This is my table:
xml_id
1
2
3
4
5
6
7
8
9
10
The result would be like this
xml_id
1
2
3
4
5
The above 5 will be deleted.

No comments:

Post a Comment