TinyPortal

Development => Support => Topic started by: Jerri Blank on February 01, 2007, 09:55:51 PM

Title: Deleting all but most recent shouts
Post by: Jerri Blank on February 01, 2007, 09:55:51 PM
Is there a SQL query I can run on the shouts table to delete all but the most recent 100 or so shouts?  Um, wait, is there a shouts table?  Where are the shouts stored?


Thanks,

jb
Title: Re: Deleting all but most recent shouts
Post by: Lesmond on February 01, 2007, 10:05:30 PM
TinyPortal admin>Manage Blocks>Shoutbox
Title: Re: Deleting all but most recent shouts
Post by: Jerri Blank on February 01, 2007, 11:44:17 PM
Thanks, but I don't want to delete all the shouts, nor do I want to do it one page at a time, since I have 896 pages of them.  :o  I was looking for a query I could run as a shortcut.



jb
Title: Re: Deleting all but most recent shouts
Post by: Lesmond on February 02, 2007, 12:26:54 AM
They are stored in Table: smf_tp_variables, but I am not sure how to query the database its not one of my strong Points, hopefully someone will come along with a better idea :)
Title: Re: Deleting all but most recent shouts
Post by: Jerri Blank on February 02, 2007, 12:32:39 AM
Found it.

Here's my query: DELETE * FROM `smf_tp_variables` WHERE `id` < "8861"

I'm not a query expert, and the error message I keep getting is

Quote#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM `smf_tp_variables` WHERE `id` < "8861"' at line 1

I've tried the 8861 with and without quotes.  Any ideas?

Thanks,

jb
Title: Re: Deleting all but most recent shouts
Post by: brianjw on February 02, 2007, 12:55:57 AM
Quote from: Jerri Blank on February 02, 2007, 12:32:39 AM
Found it.

Here's my query: DELETE * FROM `smf_tp_variables` WHERE `id` < "8861"

I'm not a query expert, and the error message I keep getting is

Quote#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM `smf_tp_variables` WHERE `id` < "8861"' at line 1

I've tried the 8861 with and without quotes.  Any ideas?

Thanks,

jb
Have you tried without the ` marks?
Title: Re: Deleting all but most recent shouts
Post by: Jerri Blank on February 02, 2007, 01:03:15 AM
Quote from: brianjw on February 02, 2007, 12:55:57 AM
Have you tried without the ` marks?

phpmyadmin plugs them in automatically, so I'm afraid to remove them.  Plus, a SELECT query with exactly the same syntax works fine.


jb
Title: Re: Deleting all but most recent shouts
Post by: Jerri Blank on February 02, 2007, 01:11:50 AM
Okay, the problem was the "*".  Question answered - issue resolved. Thanks!



jb