Um, here's my finished query:

SELECT statement.timestamp, CONCAT(transferType.descriptionUser, " ",
COALESCE(rewards.title, "")) as descriptionUser, statement.calcType,
statement.points
        FROM `users`
        JOIN statement on
                statement.userId = users.id
        JOIN transferType on
                transferType.id = statement.transferType
        LEFT JOIN rewards on
                rewards.id = statement.rewardId
        WHERE users.id = " . $_SESSION["userId"] . "
        ORDER BY timestamp ASC

In the last 18 months, I've really got to grips with Joins etc.. Rudy
helped me through some weird probs... now it's getting easier (note,
stil not easy ;-p  )

TLC, yeah, must say nothing... if they paid me on time, they'd be a
great company... ;-p


On 21/08/07, David Precious <[EMAIL PROTECTED]> wrote:
> On Tuesday 21 August 2007 11:53:53 Tris wrote:
> > It's a lot of joins...
> > From user table, points table, rewards table, statement table...
> > I just simplified it for the post... ;-p
>
> Ah fair enough :)
>
> Did the if(...concat(..)..) work?
>
>
> > just finishing off
> > http://www.tlc-rewards.com/4462Dubli/
>
> Cool.  When PIPEX were using TLC there were some fairly good rewards on offer
> (and a fair amount of crap ones, too :) )
>
>
> --
> David Precious :: [EMAIL PROTECTED]
> http://blog.preshweb.co.uk/ :: http://www.preshweb.co.uk/
>
> ____ • The WDVL Discussion List from WDVL.COM • ____
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
> use the web interface http://e-newsletters.internet.com/discussionlists.html/
>        Send Your Posts To: wdvltalk@lists.wdvl.com
> To change subscription settings, add a password or view the web interface:
> http://intm-dl.sparklist.com/read/?forum=wdvltalk
>
> ________________  http://www.wdvl.com  _______________________
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> To unsubscribe via postal mail, please contact us at:
> Jupitermedia Corp.
> Attn: Discussion List Management
> 475 Park Avenue South
> New York, NY 10016
>
> Please include the email address which you have been contacted with.
>


-- 
Give a man a fish and he'll feed himself for a day.
Give a man a religion and he'll starve to death praying for a fish.
Anon

`We are what we pretend to be, so we must be careful what we pretend to be.`
Kurt Vonnegut

`When a person can no longer laugh at himself, it is time for others
to laugh at him.`
Thomas Szasz

____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
       Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to $subst('List.Name') as: 
$subst('Recip.EmailAddr')
To unsubscribe send a blank email to $subst('Email.UnSub')
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to