0 votes
1 view
in SQL by (22.4k points)

I have made this code for giving out +1 point, but it doesn't work properly.

mysql_query("

    UPDATE member_profile 

    SET points= ' ".$points." ' + 1 

    WHERE user_id = '".$userid."'

");

the $points variable is the userĀ“s points right now.. I want it to plus one to it.. so example if he had like 5 points, it should be 5+1 = 6.. but it doesnt, it just changes to 1

What have I done wrong? thank you

1 Answer

0 votes
by (40.3k points)

Try using the below query:

mysql_query("

    UPDATE member_profile 

    SET points = points + 1

    WHERE user_id = '".$userid."'

");

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
asked Jul 4 in SQL by Tech4ever (22.4k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...