Skip to content

Commit

Permalink
UpdateAddress was changed
Browse files Browse the repository at this point in the history
  • Loading branch information
SAYaghoubnejad committed Jan 24, 2020
1 parent 2f21f5e commit cb7ec7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snapFood.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ def deletAddress(self, address_id):
self._mycursor.execute("DELETE FROM ADDRESS WHERE addressid = %s;", (str(address_id),))
self._mydb.commit()

def updateAddress(self, user_id, address_id, x = None, y = None, city_id = None, street = None, alley = None, plaque = None, address_text = None):
self._mycursor.execute("SELECT x, y, cityid, street, alley, plaque, address_text, locationid FROM ADDRESS JOIN CITY ON ADDRESS.CITYcityid = CITY.cityid JOIN LOCATION ON ADDRESSaddressid = addressid WHERE ADDRESS.USERuserid = %s", (str(user_id),))
def updateAddress(self, address_id, x = None, y = None, city_id = None, street = None, alley = None, plaque = None, address_text = None):
self._mycursor.execute("""SELECT x, y, cityid, street, alley, plaque, `address-text`, locationid FROM ADDRESS JOIN CITY ON ADDRESS.CITYcityid = CITY.cityid
JOIN LOCATION ON ADDRESSaddressid = addressid WHERE addressid = %s""", (str(address_id),))
data = self._mycursor.fetchall()[0]
location_id = data[7]
if x == None:
Expand Down

0 comments on commit cb7ec7b

Please sign in to comment.