i have a function that retrieve data from sql server database where i am using **fetchall()** then for loop
the retrieved data are all printed on the **cmd console** but when i tried to display these result on the template it **only display the last record**.
views.py
========
def search(request):
query = cursor.execute('Select id, fullname from person')
result = query.fetchall()
for row in result:
print("ID==>",id)
IPD=row[0]
return render(request,"test.html",{"IPD":IPD})
test.html
========
{{ IPD }}