add example
authorMichael Wallner <mike@php.net>
Thu, 25 Sep 2014 11:57:14 +0000 (13:57 +0200)
committerMichael Wallner <mike@php.net>
Thu, 25 Sep 2014 11:57:14 +0000 (13:57 +0200)
pq/Result/desc.md

index d73363f0c9f1ec9cbe5cbefb1e76fe5453ebcf67..3aa81b214a669f5456ad4d38ae92a7718b0bb32d 100644 (file)
@@ -16,3 +16,21 @@ None.
 ## Throws:
 
 * pq\Exception\BadMethodCallException
+
+
+## Example:
+
+       <?php
+       
+       $connection = new pq\Connection;
+       $types = new pq\Types($connection);
+       $statement = $connection->prepare("test1", "SELECT NOW() - \$1");
+       $description = $statement->desc();
+
+       printf("%s\n", $types[$description[0]]->typname);
+
+       ?>
+
+Yields:
+
+       timestamptz