[Help] How to fix vote

Results 1 to 8 of 8
  1. #1
    Member whimpz is offline
    MemberRank
    Mar 2011 Join Date
    PhilippinesLocation
    26Posts

    [Help] How to fix vote

    hello ragezone.. i need help on fixing the vote point.. im using the lost crusade website..

    already added:
    lastvote1 datetime
    lastvote2 datetime
    lastvote3 datetime
    votepoints int

    and

    USE [ACCOUNT_DBF]
    GO
    Update ACCOUNT_TBL set votepoints = '0'

    but it didnt add points.. please help me


  2. #2
    Sorcerer Supreme NickHough is offline
    Member +Rank
    Nov 2009 Join Date
    United KingdomLocation
    397Posts

    Re: [Help] How to fix vote

    Hey, what you want to do in sql is as followed

    USE [ACCOUNT_DBF]
    GO
    Update ACCOUNT_TBL set votepoints = votepoints + 1 where account = $account

    This updates the account set by $account with +1 vote points added to the current votepoints, say i had 3 vote points, it will update to 4 vote points.

    Hope this helps, if you need any more help just ask

  3. #3
    Member whimpz is offline
    MemberRank
    Mar 2011 Join Date
    PhilippinesLocation
    26Posts

    Re: [Help] How to fix vote

    hello nickhough i tried wat u have said but i have an error capture2.jpg
    please help me ..

  4. #4
    Member Kyota is offline
    MemberRank
    Jun 2011 Join Date
    Granada, SpainLocation
    76Posts

    Re: [Help] How to fix vote

    //Deleted

  5. #5
    Sorcerer Supreme kamote is offline
    Member +Rank
    Mar 2012 Join Date
    Maplewood, MOLocation
    326Posts

    Re: [Help] How to fix vote

    you should change the $account to the account you want to add the points to and enclose it in as single quote ' '.

    Code:
    USE [ACCOUNT_DBF]
    GO
    UPDATE ACCOUNT_TBL 
    SET votepoints = votepoints + 1
    WHERE account = 'testaccount'
    if your problem is when you vote, the points doesn't save in your database, then your problem is in your .php script. check the format of the date in your .php script.. It should be the same format for the datetime data type and that's m.d.Y H:i:s

  6. #6
    Sorcerer Supreme NickHough is offline
    Member +Rank
    Nov 2009 Join Date
    United KingdomLocation
    397Posts

    Re: [Help] How to fix vote

    What i wrote is to be used in a procedure, not in a standard query (or used in the php script itself).

    Using a vote system from php you would need to use my version, otherwise it will keep updating the same account each time ($account will be set by the voter)

  7. #7
    Sorcerer Supreme kamote is offline
    Member +Rank
    Mar 2012 Join Date
    Maplewood, MOLocation
    326Posts

    Re: [Help] How to fix vote

    maybe he was using the
    Code:
    USE [ACCOUNT_DBF]
    GO
    Update ACCOUNT_TBL set votepoints = '0'
    to make the null columns = to 0. So, maybe his problem is when he votes it won't save into his database. I'm not sure. I can't understand the problem..

  8. #8
    Member whimpz is offline
    MemberRank
    Mar 2011 Join Date
    PhilippinesLocation
    26Posts

    Re: [Help] How to fix vote

    already fixed.. many thanks Kamote and also NickHough ^^



Advertisement