Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapter8/4-6DegreesFinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
cur.execute("USE wikipedia")

def getUrl(pageId):
cur.execute("SELECT url FROM pages WHERE id = %s", (int(pageId)))
cur.execute("SELECT url FROM pages WHERE id = %s", (int(pageId),))
if cur.rowcount == 0:
return None
return cur.fetchone()[0]

def getLinks(fromPageId):
cur.execute("SELECT toPageId FROM links WHERE fromPageId = %s", (int(fromPageId)))
cur.execute("SELECT toPageId FROM links WHERE fromPageId = %s", (int(fromPageId),))
if cur.rowcount == 0:
return None
return [x[0] for x in cur.fetchall()]
Expand Down