public static function executeSingleton0(string $query)
  {
    $result = self::query($query);
    $row    = $result->fetch_array(MYSQLI_NUM);
    $n      = $result->num_rows;
    $result->free();

    if (self::$mysqli->more_results()) self::$mysqli->next_result();

    if (!($n==0 || $n==1))
    {
      throw new ResultException('0 or 1', $n, $query);
    }

    return $row[0];
  }
public static function executeSingleton0(string $query)
  {
    $result = self::query($query);
    $row    = $result->fetch_array(MYSQLI_NUM);
    $n      = $result->num_rows;
    $result->free();

    if (self::$mysqli->more_results()) self::$mysqli->next_result();

    if (!($n==0 || $n==1))
    {
      throw new ResultException('0 or 1', $n, $query);
    }

    return $row[0];
  }
public static function executeSingleton0 ( string $ query ) { $ result = self :: query ( $ query ) ; $ row = $ result -> fetch_array ( MYSQLI_NUM ) ; $ n = $ result -> num_rows ; $ result -> free ( ) ; if ( self :: $ mysqli -> more_results ( ) ) self :: $ mysqli -> next_result ( ) ; if ( ! ( $ n == 0 || $ n == 1 ) ) { throw new ResultException ( '0 or 1' , $ n , $ query ) ; } return $ row [ 0 ] ; }
Executes a query that returns 0 or 1 row with one column.
Throws an exception if the query selects 2 or more rows.

@param string $query The SQL statement.

@return mixed The selected value.

@since 1.0.0
@api
Executes a query that returns 0 or 1 row with one column . Throws an exception if the query selects 2 or more rows .