TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 307
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 193
  • Total: 193

Deleting all but most recent shouts

Started by Jerri Blank, February 01, 2007, 09:55:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerri Blank

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

Lesmond

TinyPortal admin>Manage Blocks>Shoutbox

Jerri Blank

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

Lesmond

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 :)

Jerri Blank

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

brianjw

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?

Jerri Blank

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

Jerri Blank

Okay, the problem was the "*".  Question answered - issue resolved. Thanks!



jb

This website is proudly hosted on Crocweb Cloud Website Hosting.