Jump to content

Increase "points" column by 100 using form


Sprout

Recommended Posts

I finally got my points displaying, now I need to get them to increase. My database has a column called "points" which I would like to have increased by 100 on the submission of a form when the username is issued. But I cannot figure out how to do this.

 

So essentially I need an input field of my form to be for a username, which when entered would select the username from my database and increase the numer of the "points" column for that user by 100.

 

Any and all help is very much appreciated.

 

Note: This will be used for the signup form to give points to whoever recommended the user.

Link to comment
Share on other sites

This seems like the 3rd separate thread you've posted on the same topic...

 

Mmm, it is probably at least my 4th thread related to roughly the same issue, yes. However I keep changing what it is I'd like to do. Originally I wanted to know how to build an entire point system, then I tried to get help with specific code I was given elsewhere for the problem, then just how to get points displaying,

 

I spent the last 3 days mobbing through the W3Schools PHP tutorials and have a significantly better understanding of what I'm doing. I managed to get the points displaying so I don't need to worry about that, and now all I would like to know is how I can make a form increase the points column based on the username being entered.

 

I didn't think there'd be an issue given what I'm requesting help with is now a specific and slightly (though not much) changed problem than before, although the desired outcome is pretty much the same. Based on my observation on this forum and forums in general, if you don't create a new thread when you make changes to what it is you want help with then you're significantly less likely to get help. I imagine this is due to people generally not going through and reading entire threads to see if the person's problem has changed. Not to mention the fact phpfreaks doesn't allow you to edit your posts so I can't change my original posts in those threads to reflect my current goal.

 

However, if me starting new threads to reflect my updated problem is causing me to look like an annoying inconsiderate asshole who doesn't understand the community here then I very sincerely apologize. I'm not trying to be rude or spam my problems, I'm just trying to get help.

 

I'll be less hasty to start threads related to essentially the same problem in the future. I'm sorry.

Link to comment
Share on other sites

Someone suggested I do this but I don't understand how.

 

You'll need to do a SQL update statement.

The raw SQl would look like this:

UPDATE UserTable

SET points=points+100

WHERE username = $username;

 

You'll have to convert that into PHP string splicing SQL.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.