INSERT INTO tsc_user_points (user_id,event_id,points,date_added) VALUES(1,25,25,'2025-12-08 13:14:46')
SELECT
u.id AS UserID, u.first_name AS FirstName, u.last_name AS LastName,
(SELECT IFNULL(sum(p.points),0) AS PointsTotal FROM tsc_user_points p WHERE p.user_id = u.id) AS PointsTotal
FROM tsc_users u
WHERE u.id =1
Array
(
[0] => 1
[1] => Chris
[2] => Upright
[3] => 5024
)
Points: 5024