LLMS_Query_Quiz_Attempt::prepare_query()

Prepare the SQL for the query.


Return Return

(string)


Top ↑

Source Source

File: includes/class.llms.query.quiz.attempt.php

	protected function prepare_query() {

		global $wpdb;

		$from  = "FROM {$wpdb->prefix}lifterlms_quiz_attempts qa";
		$joins = $this->sql_joins();
		$where = $this->sql_where();

		if ( $this->get( 'count_only' ) ) {
			return "SELECT COUNT(*) AS total {$from} {$joins} {$where};";
		}

		if ( ! $this->get( 'no_found_rows' ) ) {
			$this->count_query = "SELECT COUNT(*) {$from} {$joins} {$where}";
		}

		return "SELECT qa.id {$from} {$joins} {$where} {$this->sql_orderby()} {$this->sql_limit()};";
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Renamed from preprare_query().
3.16.0
10.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.