Add small client example
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 May 2014 09:38:31 +0000 (11:38 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 May 2014 09:38:31 +0000 (11:38 +0200)
client.php [new file with mode: 0644]

diff --git a/client.php b/client.php
new file mode 100644 (file)
index 0000000..ebfbd61
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+$z = yaz_connect("localhost:9999");
+yaz_range($z, 1, 2);
+yaz_search($z,"rpn", "computer");
+yaz_wait();
+$error = yaz_error($z);
+if (!empty($error)) {
+    echo "Error: $error\n";
+} else {
+    $hits = yaz_hits($z);
+    echo "Result count $hits\n";
+    for ($p = 1; $p <= 2; $p++) {
+        $rec = yaz_record($z, $p, "string");
+        if (empty($rec)) break;
+        echo "----- $p -----\n$rec";
+    }
+}
+?>