PHP

PHP jest obiektowym, skryptowym jezykiem programowania zaprojektowanym do tworzenia dynamicznych stron www.


Funkcje PHP

Oficjalna strona PHP

Dodatkowe aplikacje PHP

Dodatkowe modu³y PHP

Wortal PHP
mieszkanie - suplement diety - odkrycia-geograficzne - Leki, apteka internetowa - programy partnerskie - kreskówki


maxdb_sqlstate

maxdb_sqlstate

(PECL)

maxdb_sqlstate

(no version information, might be only in CVS)

maxdb->sqlstate -- Returns the SQLSTATE error from previous MaxDB operation

Description

Procedural style:

string maxdb_sqlstate ( resource link )

Object oriented style (property):

class maxdb {

string sqlstate

}

Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error. The values are specified by ANSI SQL and ODBC.

Notatka: Note that not all MaxDB errors are yet mapped to SQLSTATE's. The value HY000 (general error) is used for unmapped errors.

Return values

Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.

See also

maxdb_errno(), maxdb_error()

Example

Przykład 1. Object oriented style

<?php
$maxdb
= new maxdb("localhost", "MONA", "RED", "DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n", maxdb_connect_error());
   exit();
}

/* Table City already exists, so we should get an error */
if (!$maxdb->query("CREATE TABLE hotel.city (ID INT, Name VARCHAR(30))")) {
   
printf("Error - SQLSTATE %s.\n", $maxdb->sqlstate);
}

$maxdb->close();
?>

Przykład 2. Procedural style

<?php
$link
= maxdb_connect("localhost", "MONA", "RED", "DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n", maxdb_connect_error());
   exit();
}

/* Table City already exists, so we should get an error */
if (!maxdb_query($link, "CREATE TABLE hotel.city (ID INT, Name VARCHAR(30))")) {
   
printf("Error - SQLSTATE %s.\n", maxdb_sqlstate($link));
}

maxdb_close($link);
?>

The above examples would produce the following output:

Warning: maxdb_query(): -6000 POS(20) Duplicate table name:CITY [I6000] <...>
Error - SQLSTATE I6000.
Skuteczne i tanie pozycjonowanie stron internetowych - sklepy internetowe - bts - plus gsm - Oprogramowenie tworzace sklepy internetowe nowszej generacji. - Programy - opisygg - Najlepsze opisy gg smutne do Twojego komunikatora - Oferujemy znane skrypty sklepy internetowe warszawa bogate portfolio. - odzyskiwanie utraconych danych - najlepsze darmowe programy w Polsce - serwis komputerowy Szczecin - pozycjonowanie bielsko - Słownik kompow - affection

G:0,M:0,Y:0