Query user info

Tools by the phpBBModders team and Community contributed tools.
Forum rules
Only post tools related to modding in here, simple.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Query user info

Postby harmlessgoat22 » 19 Aug 2008, 00:46

Here's a function I made that might be useful for larger MODs to include in a functions file. It is used for querying the users table to get user info. It isn't hard to make your own little thing like this, but you could greatly reduce the amount of code if you use a function to get user info every time instead of writing it all out, plus save your sanity. You can either specify a specific user_id, an array of user_ids, or you can change $where to make it get a certain type of user, eg one that has registered before a certain date. The code does 'WHERE ' . $where, so you don't need to include "WHERE" at the beginning, or a space. I am posting the code here in a zip, because of some stupid errors with the syntax highlighting having a limit to the number of characters, or something like that...
Attachments
query_user_stats.zip
(1.29 KiB) Downloaded 117 times
Last edited by harmlessgoat22 on 19 Aug 2008, 13:54, edited 1 time in total.

That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Query user info

Postby igorw » 19 Aug 2008, 09:43


- we're poor!

harmlessgoat22
Supporter
Supporter
Posts: 316
Joined: 18 Sep 2007, 14:35
Real name: David
Contact:

Re: Query user info

Postby harmlessgoat22 » 19 Aug 2008, 13:52


That's like, I can't beat my neighbor in an argument, so instead I kill his dog.
-Best English Teacher Ever


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Tools for MOD authors”

Who is online

Users browsing this forum: No registered users and 4 guests