mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix pg_last_error() example.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@201781 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
6124e0beed
commit
8416d00936
1 changed files with 6 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.pg-last-error">
|
||||
<refnamediv>
|
||||
|
@ -69,14 +69,12 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$pgsql_conn = pg_connect("dbname=mark host=localhost");
|
||||
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
|
||||
|
||||
if ($pgsql_conn) {
|
||||
print "Successfully connected to: " . pg_host($pgsql_conn) . "<br/>\n";
|
||||
} else {
|
||||
print pg_last_error($pgsql_conn);
|
||||
exit;
|
||||
}
|
||||
// Query that fails
|
||||
$res = pg_query($dbconn, "select * from doesnotexist");
|
||||
|
||||
echo pg_last_error($dbconn);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue