user1871567
user1871567

Reputation: 11

how to delete particular number of rows in a table using php

if i select these particular rows using

select * from wp_posts where title like 'abc%'  

it displays the rows
now i want to delete these rows using php
Can i do this or iam wrong
thanks in advance

Upvotes: 1

Views: 81

Answers (2)

Ravi Maniyar
Ravi Maniyar

Reputation: 667

If there is sensitive data like activation keys or something, you need to use binary function of mysql to check whether abc is matching with ABC or not.

Use this one:

delete from wp_posts where title like binary('ABC%')

Upvotes: 0

Fred Wuerges
Fred Wuerges

Reputation: 1965

It would be more interesting if you inform your code a little more complete. But basically the SQL command is as follows:

delete from wp_posts where title like 'abc%'  

Upvotes: 2

Related Questions