##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 11\11.01 - Query with multiple results.py
# Description: Query with multiple results
##############################################################################
import sqlite3
connection = sqlite3.connect("phonebook.db")
cursor = connection.cursor()
cursor.execute("select * from phonebook")
result = cursor.fetchall()
for record in result:
print(f"Name: {record[0]}\nPhone: {record[1]}")
cursor.close()
connection.close()