Creating a Variable that is the Sum of Two Other Variables

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-06-03T08:34:05Z Indexed on 2010/06/03 8:44 UTC
Read the original article Hit count: 326

Filed under:
|

Hello,

For the code below, I would like to make a new variable called totalScore2 that equals days + totalScore.

How can I do this?

Thanks in advance,

John

$sqlStr = "SELECT 
    l.loginid, 
    l.username, 
    l.created,
    DATEDIFF(NOW(), l.created) AS days,
    COALESCE(s.total, 0) AS countSubmissions, 
    COALESCE(c.total, 0) AS countComments,
    COALESCE(s.total, 0) * 10 + COALESCE(c.total, 0) AS totalScore

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql