$DB->get_record_sql only returning a single row

So you’ve written a query, passed it to $DB->get_records_sql() and, what’s this – only one row? What’s going on, where’s the rest of the query data? First off, make sure you are using the plural form (get_records_sql() and not get_record_sql()). If that’s not the issue then read on. The reason this can happen is that…