[Help] How to fix vote

Status
Not open for further replies.
Newbie Spellweaver
Joined
Mar 10, 2011
Messages
19
Reaction score
0
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
 
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
 
hello nickhough i tried wat u have said but i have an error Capture2 - [Help] How to fix vote - RaGEZONE Forums
please help me ..
 
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
 
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)
 
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..
 
Status
Not open for further replies.
Back