$database->getIndexes() method

Get all indexes from given table

By default it returns an array of index names. Specify true for the verbose option to get index name, type and columns (array) for each index.

Available since version 3.0.182.


// basic usage
$array = $database->getIndexes(string $table);

// usage with all arguments
$array = $database->getIndexes(string $table, $verbose = false);



Name of table to get indexes for or table.index (usually combined with verbose option).

verbose (optional)bool, int, string

Include array of verbose information for each? (default=false)

  • Omit or false (bool) to just get index names.
  • True (bool) or 1 (int) to get a verbose array of information for each index, indexed by index name.
  • 2 (int) to get regular PHP array of raw MySQL index information.
  • Index name (string) to get verbose array only for only that index.

Return value


$database methods and properties

API reference based on ProcessWire core version 3.0.184

Twitter updates

  • ProcessWire 3.0.185 (dev) core updates, plus new Session Allow module— More
    17 September 2021
  • Three new ProcessWire Textformatter modules: Find/Replace, Markdown in Markup, and Emoji— More
    3 September 2021
  • This week we have a new master version released after a year in the making. With nearly 40 pull requests, hundreds of new additions and more than 100 issue reports resolved, this new version has a ton of great new stuff— More
    27 August 2021

Latest news

  • ProcessWire Weekly #384
    In the 384th issue of ProcessWire Weekly we'll cover the latest core updates, introduce a new module called Session Allow, and highlight a new site of the week. Read on!
    Weekly.pw / 18 September 2021
  • ProcessWire 3.0.184 new master/main version
    This week we have a new master/main version released after a full year in the making. As you might imagine, this new version has a ton of great new stuff and we’ll try to cover much of it here.
    Blog / 27 August 2021
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull