I could get a single value from MySQL database on Django(Python). However, it looks like the code are too long. Is there a way to make it short codes? Thanks
result = cursor.execute("SELECT idx FROM myapp_profile WHERE full_name = '"+fullname+"' AND birthday = '"+birthday+"' LIMIT 1")
if result:
#create session
col_names = [desc[0] for desc in cursor.description]
while True:
row = cursor.fetchone()
if row is None:
break
resultsList = dict(izip(col_names, row))
profile_idx = resultsList["idx"]