We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71fa455 commit aa2e1acCopy full SHA for aa2e1ac
reference/pgsql/examples.xml
@@ -13,13 +13,14 @@
13
<programlisting role="php">
14
<![CDATA[
15
<?php
16
+
17
// Connecting, selecting database
18
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
19
or die('Could not connect: ' . pg_last_error());
20
21
// Performing SQL query
22
$query = 'SELECT * FROM authors';
-$result = pg_query($query) or die('Query failed: ' . pg_last_error());
23
+$result = pg_query($dbconn, $query) or die('Query failed: ' . pg_last_error());
24
25
// Printing results in HTML
26
echo "<table>\n";
@@ -37,6 +38,7 @@ pg_free_result($result);
37
38
39
// Closing connection
40
pg_close($dbconn);
41
42
?>
43
]]>
44
</programlisting>
0 commit comments