+ link + newLine
else:
return print_row(row,newLine)
-
+
+
+def print_name_count(row,newLine):
+ if newLine=='<br>':
+ script = "name.py?name=" + row[0]
+ link = link_Template.substitute(script =\
+ script, text = row[0])
+ return str(row[1]) + " people called "+link + newLine
+ else:
+ return print_row(row,newLine)
def print_tagged_name(relationship,row,newLine):
if row[0]==None:
+" GROUP BY firstName"\
+" ORDER BY count(*) DESC;"
- out = print_query(s,(),newLine)
-
+ out = ''
+ for row in run_query(s,()):
+ out = out + print_name_count(row,newLine)
+
+ return out
+
+def people_with_name(name,newLine):
+ s = "SELECT Name, ID"\
+ +" FROM people"\
+ +" WHERE Name LIKE ?;"
+
+ out = ''
+
+ t = (name + '%',)
+
+ for row in run_query(s,t):
+ out = out + name_html(row,newLine) + newLine
return out
conn = askQuestion.connect()
-#o = askQuestion.count_names('\n')
+o = askQuestion.count_names('\n')
-#print o
+print o
#o = askQuestion.count_birth_month('\n')
#print o
#o = askQuestion.list_people('\n')
#print o
-o = askQuestion.count_age_at_child('\n')
-print o
+#o = askQuestion.count_age_at_child('\n')
+#print o
askQuestion.close(conn)