Name the Minnesota theaters that fit these descriptions:
';
$key1 = 'bond_cast';
$key2 = 'bond_artist';
$key3 = 'bond_audience';
$sql = "select count(a) from {survey} where q like '%s' and uid=%d";
$count = db_result(db_query($sql, 'bond%', $user->uid));
if (isset($_POST['submit'])) {
if (!empty($_POST['bond1'])) {
$sql = "insert into {survey} (uid, q, a) values (%d, '%s', '%s')";
db_query($sql, $user->uid, $key1, $_POST['bond1']);
}
if (!empty($_POST['bond2'])) {
$sql = "insert into {survey} (uid, q, a) values (%d, '%s', '%s')";
db_query($sql, $user->uid, $key2, $_POST['bond2']);
}
if (!empty($_POST['bond3'])) {
$sql = "insert into {survey} (uid, q, a) values (%d, '%s', '%s')";
db_query($sql, $user->uid, $key3, $_POST['bond3']);
}
print 'Thanks for taking our survey. Your answer has been included in the results below.';
} else {
if ($user->uid) {
if ($count == 0) {
?>
Login so you can add your answer to this survey. Check out the results so far below.';
}
}
print '
';
$sql = "select a, count(*) as count_a from {survey} where q = '%s' group by a order by count_a desc";
$result = db_query($sql, $key1);
if (!empty($result)) {
print "
Results for best dressing room to bond with the cast:
";
while ($data = db_fetch_object($result)) {
print '- ' . $data->a . ' (' . $data->count_a . ')
';
}
print '
';
}
$result = db_query($sql, $key2);
if (!empty($result)) {
print "
Results for best backstage for secret love affairs:
";
while ($data = db_fetch_object($result)) {
print '- ' . $data->a . ' (' . $data->count_a . ')
';
}
print '
';
}
$result = db_query($sql, $key3);
if (!empty($result)) {
print "
Results for best place for onstage nude scenes:
";
while ($data = db_fetch_object($result)) {
print '- ' . $data->a . ' (' . $data->count_a . ')
';
}
print '
';
}
?>