Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25707

There is no easy way to work out how many results are returned from a get_recordset()

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Dan Marsden just pointed out that in 2.0 you can't work out how many results there were in a get_recordset without looping through them. Specifically he wanted to know if the recordset was empty.

      In the structure returned I see a "num_rows" protected variable ... is this set for all databases? Could we add a method to moodle_recordset class to access it? Something like count() perhaps?

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: