hiiii all,
Can anyone please help me regarding this ....
i have table with 2 cloumns in a database "details"
Name Age
john 26
Mary 18
Nancy 20
i want to get only the Age in an array.
I tired in this way:
db=MySQLdb.connect(user="root",passwd="my",db="mydb")
cursor=db.cursor()# prepare a cursor object using cursor() method
abc = "SELECT Age FROM Details "
try:
# Execute the SQL command
cursor.execute(abc)
*********************
for row in cursor
print row
array[row]************ # Commit your changes in the database
db.commit()
except:
db.rollback() # Rollback in case there is any error
db.close() # disconnect from server
I want ages 26,16,20 in an array like array =
Please help me out.........i tried in many ways but i am not able to do this......