• Resolved pekos

    (@pekos)


    Hi Antoine

    I am running the Qatar league on a test basis with only 2 users me being one of the users. Even though I have made my predictions the other user could not submit them in time and right now he has 4 matches without predictions, those matches are already finished. Without having to deal with changing dates for the matches in the admin area, is there an SQL query that will allow me to insert the predictions into the predictions table for specific users? I know the match ids, and the user ids, therefore, I can get the values, but for me to be 100% sure I am using the correct statement, I would like you (if possible of course) to have the syntax for inserting the values into the table.

    I am confident with running SQL scripts, but I want to be 100% sure I am doing it right, and this is the reason I am asking you for the syntax.

    Kind Regards
    Periklis

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

    (@antoineh)

    hi,

    the SQL is pretty straightforward*. The user_id and match_id you already know. In my example I have a user with ID 1 and I am inserting the prediction for match with ID 2.

    Then, home_score is the score for the first team and away_score for the visiting team. E.g. I entered a 3-0 score in my example. The last value is 0 if you do not want to use the joker/multiplier on that match. Set it to 1 if you do want to activate the joker.

    INSERT INTO pool_wp_predictions 
      (user_id, match_id, home_score, away_score, has_joker) 
    VALUES
      (1, 2, 3, 0, 0)

    *) if you have a different database prefix, then you’ll need to adjust the table name in my example.

    Thread Starter pekos

    (@pekos)

    Hi Antoine

    thanx for the reply. Yes, this is pretty simple.
    It works as expected.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘mysql query for predictions’ is closed to new replies.