ziggynerja Posted October 27, 2011 Share Posted October 27, 2011 Hello all, I have a membership website which is using sessions... and ive been asked to add some promotion points system. So that each user is able to see how many promotion points they have... Now, I'm a beginner in mysql and php, but feel I'm learning fairly quickly. What I need help with, is to be able to display the amount of promotion points for the logged in user. I created a new field in my "essenti1_Users" table for the promotion code. database is called "essenti1_membership" table is "essenti1_Users" feild is "promo" I think im going to have to manually add the points to each user manually through phpMyAdmin Navicat unfortunatly. Unless anyone has any other ideas just for adding the points to each user account? ziggynerja is online now Add to ziggynerja's Reputation Report Post Edit/Delete Message Quote Link to comment https://forums.phpfreaks.com/topic/249906-pull-user-info-from-mysql-db-in-session/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted October 27, 2011 Share Posted October 27, 2011 google this : php mysql Quote Link to comment https://forums.phpfreaks.com/topic/249906-pull-user-info-from-mysql-db-in-session/#findComment-1282671 Share on other sites More sharing options...
ziggynerja Posted October 27, 2011 Author Share Posted October 27, 2011 google this : php mysql Oh right, silly me for thinking I could ask for help/opinions in the "PHP Coding Help " section. Quote Link to comment https://forums.phpfreaks.com/topic/249906-pull-user-info-from-mysql-db-in-session/#findComment-1282672 Share on other sites More sharing options...
Drongo_III Posted October 27, 2011 Share Posted October 27, 2011 Hi Mate I'm no php superstar liek some of the guys here but you could try somethnig like this: //this assumes you've already connected to your DB $sql = "SELECT promo FROM TABLENAME WHERE id = USERID"; $result = mysql_query($sql); $promo = mysql_fetch_assoc($result); echo $promo[promo]; //Or if you wanted to assign it to the sessino then: $_SESSION['promo']= $promo[promo]; //then you could do echo echo $_SESSION['promo']; Incidentally just writing this off the top of my head so i can't be 100% it works without testing it but something along those lines. Hello all, I have a membership website which is using sessions... and ive been asked to add some promotion points system. So that each user is able to see how many promotion points they have... Now, I'm a beginner in mysql and php, but feel I'm learning fairly quickly. What I need help with, is to be able to display the amount of promotion points for the logged in user. I created a new field in my "essenti1_Users" table for the promotion code. database is called "essenti1_membership" table is "essenti1_Users" feild is "promo" I think im going to have to manually add the points to each user manually through phpMyAdmin Navicat unfortunatly. Unless anyone has any other ideas just for adding the points to each user account? ziggynerja is online now Add to ziggynerja's Reputation Report Post Edit/Delete Message Quote Link to comment https://forums.phpfreaks.com/topic/249906-pull-user-info-from-mysql-db-in-session/#findComment-1282675 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.