• Resolved andys007

    (@andys007)


    Hi is have a data table that works fine with the SQL Statement in Where
    Club = “Burn” AND Season = “24” AND Private = “Yes” AND WP_User_ID = @wpda_wp_user_id OR @wpda_wp_user_id = “1” OR @wpda_wp_user_id = “4”

    It works as below

    CREATE VIEW Burn_Catches as
    Select Name,Date,Hours,Trout_4,Trout4_10,Trout_10,Grayling_4,Grayling4_10,Grayling_10,Section from Catches where Club = “Burn” AND Season = “24” AND Private = “Yes”

    but when I append AND WP_User_ID = @wpda_wp_user_id OR @wpda_wp_user_id = “1” OR @wpda_wp_user_id = “4”

    I get WordPress database error: View’s SELECT contains a variable or parameter

    I am sure it’s to do with SQL somewhere, but not sure, can you advise please?
    Thanks

    Andy

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SQL statement differnce betweem old and new.’ is closed to new replies.