pg_set_error_verbosity

(PHP 5)

pg_set_error_verbosity --  Determines the verbosity of messages returned by pg_last_error() and pg_result_error().

Opis

int pg_set_error_verbosity ( [resource connection, int verbosity] )

Determines the verbosity of messages returned by pg_last_error() and pg_result_error().

pg_set_error_verbosity() sets the verbosity mode, returning the connection's previous setting. In TERSE mode, returned messages include severity, primary text, and position only; this will normally fit on a single line. The default mode produces messages that include the above plus any detail, hint, or context fields (these may span multiple lines). The VERBOSE mode includes all available fields. Changing the verbosity does not affect the messages available from already-existing result objects, only subsequently-created ones.

Parametry

connection

PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().

verbosity

The required verbosity: PGSQL_ERRORS_TERSE, PGSQL_ERRORS_DEFAULT or PGSQL_ERRORS_VERBOSE.

Zwracane wartości

The previous verbosity level: PGSQL_ERRORS_TERSE, PGSQL_ERRORS_DEFAULT or PGSQL_ERRORS_VERBOSE.

Przykłady

Przykład 1. pg_set_error_verbosity() example

<?php
  $dbconn
= pg_connect("dbname=publisher") or die("Could not connect");

  if (!
pg_connection_busy($dbconn)) {
      
pg_send_query($dbconn, "select * from doesnotexist;");
  }
  
  
pg_set_error_verbosity($dbconn, PGSQL_ERRORS_VERBOSE);
  
$res1 = pg_get_result($dbconn);
  echo
pg_result_error($res1);
?>



Język PHP to dzisiaj powszechnie przyjęty standard, podstawa tworzenia dynamicznych stron WWW, opartych na bazach danych.

PHP to język skryptowy. Znaczy to, że jest to język nie kompilowalny. Program jest wykonywany przez interpreter na podstawie jego kodu źródłowego. Język PHP to element technologii internetowej SERVER-SIDE. Znaczy to, że kod języka jest wykonywany od strony serwera (na serwerze).

W jakim celu używac PHP? Po co to komu?

Załóżmy, że potrzebujemy takiej strony internetowej, która wyświetli zawsze bieżącą datę. Dzięki technologii PHP, datę i godzinę odczytywać można z miejsca gdzie wykonuje się skrypt, np. gdy serwer znajduje się w USA a my w Polsce to widoczna jest różnica w czasie który zostanie wyświetlony.

nieuradz hotele kraków Accuphase Mael fsu hurtownia łożysk tocznychwiza do rosji, końcówki kolekcji, usuwanie zmarszczek, kaszuby domki, wizy do rosji, szablony stron internetowych, Pompy, monitory samsung, Ustawienia konta steam, chorwacja forum, marmur, narty