Skip to content

Instantly share code, notes, and snippets.

@Spoygg
Created December 13, 2012 11:01
Show Gist options
  • Save Spoygg/4275750 to your computer and use it in GitHub Desktop.
Save Spoygg/4275750 to your computer and use it in GitHub Desktop.
$country = '';
$sql = "select qst.system_name as system_name, qst.question as question, ans.answer as answer from " . EVENTS_ANSWER_TABLE . " ans inner join " . EVENTS_QUESTION_TABLE . " qst on ans.question_id = qst.id where qst.system_name = 'country' and ans.attendee_id = " . $attendee_id;
$questions = $wpdb->get_results($sql, ARRAY_A);
if ($wpdb->num_rows > 0 && $wpdb->last_result[0]->question != NULL) {
foreach ($questions as $q) {
$country = $q['answer'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment