Simple Machines Community Forum

General Community => Scripting Help => Topic started by: worldfiddler on September 22, 2022, 03:58:59 PM

Title: Simple MySQL query
Post by: worldfiddler on September 22, 2022, 03:58:59 PM
Hello,

I am trying to find a way for a forum owner to run a few queries to extract some data for me, basically all the posts and comments I've made on that forum and output it all to a csv file.

He has database access and admin rights etc, but he not a programmer/coder as such. He referred me to this group for some help.

I'm just wanting to get the syntax correct. I can get the correct table names and fields later.

Assuming the table is [member_posts], containing field [member_name], should this query work?

SELECT * FROM member_posts WHERE member_name = 'worldfiddler'

Thanks in advance!

Jim
Title: Re: Simple MySQL query
Post by: Sir Osis of Liver on September 22, 2022, 05:31:14 PM
Posts are in the messages table, default table prefix is smf_, so it would be smf_messages unless another prefix was used.  You can use poster_name or id_member to find yours.
Title: Re: Simple MySQL query
Post by: worldfiddler on September 22, 2022, 05:58:42 PM
Thank you. I'll get him to try that.
Title: Re: Simple MySQL query
Post by: worldfiddler on September 26, 2022, 04:32:40 PM
Yep, it worked OK.

Thanks.
Title: Re: Simple MySQL query
Post by: Doug Heffernan on September 26, 2022, 05:28:28 PM
Glad to hear that it worked. Marking this as solved.