function queryColumn($query)
  {
    $data = [];
    $res = $this->q($query);
    while ($row = $res->fetch_row())
    {
      if ($res->field_count == 1)
        $data[] = $row[0];
      else
        $data[$row[0]] = $row[1];
    }
    $res->close();
    return $data;
  }
function queryColumn($query)
  {
    $data = [];
    $res = $this->q($query);
    while ($row = $res->fetch_row())
    {
      if ($res->field_count == 1)
        $data[] = $row[0];
      else
        $data[$row[0]] = $row[1];
    }
    $res->close();
    return $data;
  }
function queryColumn ( $ query ) { $ data = [ ] ; $ res = $ this -> q ( $ query ) ; while ( $ row = $ res -> fetch_row ( ) ) { if ( $ res -> field_count == 1 ) $ data [ ] = $ row [ 0 ] ; else $ data [ $ row [ 0 ] ] = $ row [ 1 ] ; } $ res -> close ( ) ; return $ data ; }
If two fields are queried, the first is used as an index.
If two fields are queried the first is used as an index .