Last active
August 29, 2015 14:00
-
-
Save aaronroberson/7a8e6584e204c9ac5ee2 to your computer and use it in GitHub Desktop.
Update pledge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REPLACE THE BRACKETS WITH THE APPROPRIATE VALUES | |
# For example, WHERE user.email = '[the email address]' | |
# becomes WHERE user.email = 'aaron@blaremedia.net' | |
# This SELECT query returns the email, pledge and pledge id | |
# for the user. You will use the pledge id returned from this | |
# query to update the pledge in the UPDATE query below | |
SELECT user.email, pledge.pledge, pledge.id | |
FROM `jos_users` as user | |
INNER JOIN `jos_ibike_rider` as rider | |
ON user.id = rider.user_id | |
INNER JOIN `jos_ibike_pledge` as pledge | |
ON rider.id = pledge.rider_id | |
WHERE user.email = '[the email address]' | |
AND pledge.for_year = 2014 | |
#This will update the pledge | |
UPDATE `jos_ibike_pledge` as pledge | |
SET pledge.pledge = [desired pledge amount] | |
WHERE pledge.id = [pledge id from previous query] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment