Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Can someone please tell me how to delete this database range


3 replies to this topic

#1 bigbob2

  • Community Member
  • 77 posts
  • Real Name:Kevin

Posted 12 January 2012, 22:26

The follwoing command in phpmyadmin deletes one entry (number 412254).

DELETE FROM `dbase_dbase`.`search_queries` WHERE `search_queries`.`search_id` = 412254;

I want to delete all entries in this table. Is there a command to delete all from this table or from a range (ie. from record 1 to record 100000).

Please help

Kev

#2 mattjt83

  • Community Member
  • 108 posts
  • Real Name:Matt Toste
  • Gender:Male
  • Location:CA, USA

Posted 12 January 2012, 23:22

DELETE FROM `dbase_dbase`.`search_queries` WHERE `search_queries`.`search_id` <= 100000;

So that *should* delete all records that are less than or equal to 100000

BACKUP before you start messing with your db!
Matt

#3 bigbob2

  • Community Member
  • 77 posts
  • Real Name:Kevin

Posted 12 January 2012, 23:39

View Postmattjt83, on 12 January 2012, 23:22, said:

DELETE FROM `dbase_dbase`.`search_queries` WHERE `search_queries`.`search_id` <= 100000;

So that *should* delete all records that are less than or equal to 100000

BACKUP before you start messing with your db!

Awesome! Thanks, I will test it now.

Kev

#4 geoffreywalton

  • Community Sponsor
  • 7,731 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 13 January 2012, 08:12

If you look at the db in phpmyadmin you get a list of all tables.

You can choose the option to "Truncate" which empties the entire table.

HTH

G
Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.