• Resolved pglock

    (@pglock)


    Hi,
    I’m extending the excellent football pool plugin to enable people interested in crypto currencies to predict the changes between different pairs of coins. One difference s that the value of a coin can go down. I need to show negative ‘scores’ both for predictions and actual scores.
    I notice that if I attempt to make a negative prediction in the /pool page the score reverts to 0 on save.
    How would I change this?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author AntoineH

    (@antoineh)

    The database table for the predictions uses unsigned tinyint fields for the storage of the numbers. So, you’ll have to change the fields to something that allows negative values, e.g.

    ALTER TABLE pool_wp_predictions 
    CHANGE home_score home_score INT NOT NULL DEFAULT '0', 
    CHANGE away_score away_score INT NOT NULL DEFAULT '0';
    

    p.s. you may have to change the table name to your situation.

    • This reply was modified 7 years ago by AntoineH.
    Thread Starter pglock

    (@pglock)

    Brilliant! That did the trick. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Negative Scores’ is closed to new replies.