Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8978009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:30:23+00:00 2026-06-15T19:30:23+00:00

i got a point system where people can buy diffrent things for points they

  • 0

i got a point system where people can buy diffrent things for points they get. Now i’m going to make so people can upgrade to [PRO] user. when they register they get logged in mysql as [user]. I’m making a code so that after action they lose 50 points and their [user] get replaced with [PRO]. but now i’m, with the replacement with [pro]. this is the code i have:

$insert = "UPDATE `users` SET `points` = (`points`-50) WHERE `username` = '".$username."' and points > 50";
mysql_query($insert);
if (mysql_affected_rows() > 0)
{

    // other codes

  $insert =  "UPDATE users SET rights=' [user]'  WHERE rights=' [pro]' WHERE `username` = '".$username."'";
    mysql_query($insert); 
header('location: succes.php');
}else{
    echo "You don't have enough points to upgrade to [PRO]";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:30:24+00:00Added an answer on June 15, 2026 at 7:30 pm

    Instead of:

    $insert =  "UPDATE users SET rights=' [user]'  WHERE rights=' [pro]' WHERE `username` = '".$username."'";
    

    Try:

    $insert =  "UPDATE users SET rights=' [pro]' WHERE `username` = '".$username."'";
    

    You have two WHERE clauses and that won’t work. Just update their rights to pro once you take away 50 points.

    You could also combine your first and second queries with something like this:

    $insert = "UPDATE `users` SET `points` = (`points`-50), rights = ' [pro]' WHERE `username` = '".$username."' and points > 50";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a point system where i want people to get 1 more point
Ok, let's get straight to the point. I got 2 questions 1. Why self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
I am going through ASP.NET MVC 3 tutorial . Got to the point where
I need to make fixed point number class inherit from System.Type. class FixedPoint :
Made the upgrade to Mac OS X 10.8 (Mountain Lion) and get now the
It is quite possible that I may not have got the point, but I
I'm at my wit's end. The Share Point guy got a brain tumor and
At some point Find All References feature got broken for a single solution that
Case in point : I've got a handle to a window (for instance, using
got a problem with dets:to_ets/2 Could somebody point me to an example online? Ive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.