Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: pg_last_error - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

pg_last_notice" width="11" height="7"/> <pg_insert
Last updated: Fri, 05 Sep 2008

view this page in

pg_last_error

(PHP 4 >= 4.2.0, PHP 5)

pg_last_error特定の接続から直近のエラーメッセージ文字列を取得する

説明

string pg_last_error ([ resource $connection ] )

pg_last_error() は、指定した connection から直近のエラーメッセージを返します。

エラーメッセージは、内部的な PostgreSQL(libpq) 関数コールにより 上書きされる可能性があります。PostgreSQL モジュール関数の中で複数の エラーが発生した場合には、この関数は適切なエラーメッセージを返さない 可能性があります。

エラー処理を改善するために pg_result_error()pg_result_error_field()pg_result_status() および pg_connection_status() を使用ください。

注意: この関数は、以前は pg_errormessage() と呼ばれていました。

パラメータ

connection

PostgreSQL データベース接続リソース。connection が指定されていない場合はデフォルトの接続が使用されます。 デフォルトの接続は、直近の pg_connect() あるいは pg_pconnect() によって作成されたものです。

返り値

指定した connection の直近のエラーメッセージを 含む文字列を返します。エラー時には FALSE を返します。

例1 pg_last_error() の例

<?php
  $dbconn 
pg_connect("dbname=publisher") or die("接続できませんでした");

  
// 失敗するクエリ
  
$res pg_query($dbconn"select * from doesnotexist");
  
  echo 
pg_last_error($dbconn);
?>



add a note add a note User Contributed Notes
pg_last_error
There are no user contributed notes for this page.

pg_last_notice" width="11" height="7"/> <pg_insert
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites