chriskl Wed Nov 30 20:29:57 2005 EDT
Modified files: /phpdoc/en/reference/pgsql/functions pg-last-error.xml Log: Fix pg_last_error() example. http://cvs.php.net/diff.php/phpdoc/en/reference/pgsql/functions/pg-last-error.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc/en/reference/pgsql/functions/pg-last-error.xml diff -u phpdoc/en/reference/pgsql/functions/pg-last-error.xml:1.8 phpdoc/en/reference/pgsql/functions/pg-last-error.xml:1.9 --- phpdoc/en/reference/pgsql/functions/pg-last-error.xml:1.8 Mon Jul 4 00:44:21 2005 +++ phpdoc/en/reference/pgsql/functions/pg-last-error.xml Wed Nov 30 20:29:56 2005 @@ -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>