Thread: Ifnull

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    20
    Rep Power
    0

    Ifnull


    Always when running this query i get SQL error: 1305 (FUNCTION database.binomial_ci does not exist)

    Code:
    INSERT INTO votes (GroupID, Ups, Total, Score)
    SELECT $NewGroupID, UpVotes, TotalVotes, VoteScore
    FROM (
    SELECT
    IFNULL(SUM(IF(Type = 'Up', 1, 0)), 0) As UpVotes,
    COUNT(1) AS TotalVotes,
    binomial_ci(IFNULL(SUM(IF(Type = 'Up', 1, 0)), 0), COUNT(1)) AS VoteScore
    FROM users_votes
    WHERE GroupID = $NewGroupID
    GROUP BY GroupID
    ) AS a
    ON DUPLICATE KEY UPDATE
    Ups = a.UpVotes,
    Total = a.TotalVotes,
    Score = a.VoteScore;
    It used to work in the past but since i updated everything on the server it goes weird every time.

    Server type: MySQL
    Server version: 5.5.54-0+deb8u1 - (Debian)
    Protocol version: 10
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,024
    Rep Power
    9616
    As the error message pretty clearly states, there is no "binomial_ci" function. Is it something you made? Did you forget to recreate that function when you updated?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    20
    Rep Power
    0
    Hmm, i always tought that the binomial_ci is from the tables charset type..hmm found the functioon..yeah it wasnt placed at all.

IMN logo majestic logo threadwatch logo seochat tools logo