Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-07 19:40:50

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,659
GitHub Twitter

TXP MySQL query

Hi folks ;)

I would like to extract some data from two TXP tables (txp_users and textpattern). Which is the best code to grab the total of articles by users from a specific section?
Note: I need to display the results on only one line by user.

This one doesn’t make the job:

$authors =
		getRows(
			'SELECT * FROM '.safe_pfx('txp_users').' AS a 
			INNER JOIN '.safe_pfx('textpattern').' AS p 
			ON (a.privs < "5" AND p.Status = "4" AND p.Section = "articles") GROUP BY a.user_id'
		);

Tanks by advance.

Last edited by Pat64 (2011-12-07 19:45:52)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2011-12-12 20:47:03

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: TXP MySQL query

I don’t know MySql from Pancakes but whenever I use smd_query and read it’s docs I can figure what needs done. I’m sure you aware of that plugin and I know this a MySql question but this thread looked lonely and these are my two cents.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#3 2011-12-12 21:19:06

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,659
GitHub Twitter

Re: TXP MySQL query

Hi Josh.

Thanks for your reply (in the absence of another ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB