Burton Posted April 19, 2015 Share Posted April 19, 2015 (edited) I want to update users when they purchase premium by their email OR database ID, either one would work, BUT the only way it's working for me at the moment is by me entering their ID in the $_SESSION at the top. I want the page to get the users ID OR email after they purchase. I have asked this many places and have got no answer, people basically tell me to just type it. That would be crazy to do that for every single user. If you have an answer, PLEASE! I literally beg for you to copy the code above and place stuff where it needs to be, I've been stuck for days/weeks. I've tried EVERYTHING, except the right thing. Nothing is working for me on this, I also can't find anything on Google about it. I'm not an expert with PHP, so I may be missing bits, if I am, feel free to tell me I'm doing it wrong and let me know what I need to do. <?phprequire_once ('vendor/autoload.php');$_SESSION['user_id'] = '?';$stripe = array( "secret_key" => "sk_test_vDYOBYxCErhrgGCeWQJhR4mQ", "publishable_key" => "pk_test_4mIuE3OsajKO4cnFppcDDISu" ); StripeStripe::setApiKey($stripe['secret_key']);$db = new PDO('mysql:host=127.0.0.1;dbname=blog', 'root', '');$userQuery = $db->prepare(" SELECT id, username, email, premium FROM users WHERE id = id "); $userQuery->execute(['user_id' => $_SESSION['user_id']]); $users = $userQuery->fetchObject(); Edited April 19, 2015 by Burton Link to comment Share on other sites More sharing options...
justsomeguy Posted April 22, 2015 Share Posted April 22, 2015 Where does the user ID or email come from? Are they stored in the session when the user logs in? Link to comment Share on other sites More sharing options...
CoconutJJ Posted April 29, 2015 Share Posted April 29, 2015 UPDATE FROM users SET column_name = 'DATA', column_name = 'DATA', column_name = 'DATA', WHERE column_name='DATA' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now