My db is storing hotel_names in 1-7 rows but counts are stored in 8-14 rows.i want to store counts according to hotel_name. Actually i am stuck at one point. i want to display like this:
Hotel_id Hotel_name| Is_pool | Pool_count
1 cAnberra hotel 1 1.4
2 Hayat hotel 1 1.2
3 grand 1 1.0
4 New one hotel 1 1.99
5 7 hotels 1 0.98
6 New light 1 0.78
7 Lime light hotel1 0.1
but my code is dislaying :
Hotel_id Hotel_name Is_pool Pool_count
1 cAnberra hotel 1
2 Hayat hotel 1
3 grand 1
4 New one hotel 1
5 7 hotels 1
6 New light 1
7 Lime light hotel 1
8 1.4
9 1.2
10 1.0
11 1.99
12 0.98
13 0.78
14 0.1
This is my code:
for hotel in myarrayUrl[ind_pos]:
print("The myarrayUrl converted to a list")
print(hotel)
c.execute("INSERT INTO hotels (hotel_name, is_pool) VALUES (?,?)" , [hotel,1])
for count in myarray[ind_pos]:
print("The myarray converted to a list")
print(count)
c.execute("INSERT INTO hotels (pool_count) VALUES (?)" , [count])
help me.thanks in advance.