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
https://forums.phpfreaks.com/topic/249027-mysql-help/
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
https://forums.phpfreaks.com/topic/249027-mysql-help/#findComment-1278974
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.