For website developers/programmers.

Results 1 to 3 of 3
  1. #1
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    For website developers/programmers.

    So, I got a database for the 2011 files from Rotana, and I executed and stuff and everything worked, then I wanted to test the register page of my website that was working, I was surprised when it gave me an error because I had tested it before. But then I read the error, the account table has something new with the pgradeid. This is a discussion because the queries will be different and I guess much will be changed.

    Error:
    Code:
    Warning: mssql_query() [function.mssql-query]: message: The INSERT statement conflicted with the FOREIGN KEY constraint "PremiumGrade_Account_FK1". The conflict occurred in database "GunzDB", table "dbo.PremiumGrade", column 'PGradeID'. (severity 16)
    I will take a look in it right away, and I'll post a fix for it.


  2. #2
    Mako is insane. ThePhailure772 is offline
    MemberRank
    Sep 2007 Join Date
    1,115Posts

    Re: For website developers/programmers.

    ALTER TABLE Account DROP PGradeID
    ALTER TABLE Account ADD PGradeID INT NOT NULL DEFAULT(0)

  3. #3
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: For website developers/programmers.

    Wrong fix,

    correct one is

    Code:
    Use [GunzDB]
    INSERT INTO PremiumGrade (PGradeID, Name) VALUES (0, 'free')
    
    INSERT INTO UserGrade (UGradeID, Name) VALUES (0, 'free')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (1, 'Subscription Account')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (2, 'Best Gamer')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (100, 'Marked Man')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (101, 'First Warning')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (102, 'Second Warning')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (103, 'Third Warning')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (104, 'Chatting Forbidden')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (105, 'Time Block')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (252, 'Event Manager')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (253, 'Permanent Block')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (254, 'Developer')
    INSERT INTO UserGrade (UGradeID, Name) VALUES (255, 'Manager')
    THAT'S IF YOU'RE ONLY GETTING THE ERROR.
    Last edited by Vusion; 08-12-11 at 03:24 PM.



Advertisement