Jump to content

MYSQL help ??


fcooper94

Recommended Posts

Hey Guys

 

I need some help, I have these two tables:

 

(vouchers)

mA2pAr.png

 

(login)

5jPn9a.png

 

I also, have this page. (redeem.php)

4JtIk2.png

 

What i need, is when a user types in a voucher code, i adds 100 credits to there user account.

 

My Logged in Session is currently:

$username = $_SESSION['loggedinsuccesfully'];

 

Also, when the voucher has been used, the status of the voucher needs to change to 1 (means it cant be used again)

 

If anyone can offer me this code, i will appreciate it.

 

Thanks again

 

fCooper94

Link to comment
Share on other sites

So, is the voucherid in any way related to the ID value?

 

Your login code should store both the username and the user id in session variables so that your code can operate the most efficiently (using a numeric id in queries to match up information is much faster than using a multiple character username string.)

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.