Adding an array in a SQL query
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Adding an array in a SQL query
Hi Zinga, I have this code so far - see attachment.

I made it as one of my users requested it and its my first plugin so its probably full of stupid mistakes.

Right now I am trying to work out how to add a total to the bottom of the table - like total views, downloads, comments....

I chose the data from my database with this kind of thinking:

I wanted to have the threads and views etc so I chose the threads table to start from. Then I linked to the xtattachments to get the values I had put in my Custom Thread Fields. I have 4 different upload files thread fields where I used the pipe separated values to allow rar or zip. I assigned the keys fupload, fupload2, fupload3 and fupload4 to those thread fields, so they are the ones I pulled out.  In the select I also added the option to get the downloads count and then added that into my templates.

It kind of works..... I noticed that if there are multiple file attachments to a thread then in the downloads field it does not get the TOTAL value of the downloads, just one.


Attached File(s)
.zip  MyUploadStats.zip (Size: 2.54 KB / Downloads: 419)


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 11-02-2010 03:33 PM by leefish.)
11-02-2010 01:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Adding an array in a SQL query - leefish - 11-02-2010, 04:58 AM
RE: Adding an array in a SQL query - RateU - 11-02-2010, 05:42 AM
RE: Adding an array in a SQL query - RateU - 11-02-2010, 07:02 AM
RE: Adding an array in a SQL query - techu - 11-02-2010, 12:16 PM
RE: Adding an array in a SQL query - leefish - 11-02-2010 01:41 PM
RE: Adding an array in a SQL query - RateU - 11-03-2010, 07:31 AM

 Standard Tools
Forum Jump: