Skip to content

Commit 6cf9991

Browse files
committed
Fix issue with retrieving data from SQLite
database
1 parent 28fcab7 commit 6cf9991

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pysqlitehelper/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def selectWhereId(self,table_name:str,id:int)->dict:
3535
columns=self.getColumns(table_name)
3636
data={}
3737

38-
for i in range(0,len(columns)):
39-
data[columns[i]]=cursor[i]
38+
if len(columns) > 0:
39+
for i in range(0,len(columns)):
40+
data[columns[i]]=cursor[i]
4041
return data
4142

4243
def insert(self,table_name,values)->bool:

0 commit comments

Comments
 (0)