Update of /cvsroot/monetdb/clients/src/examples/php
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31947/php

Added Files:
      Tag: Clients_1-20
        monetdb.php 
Log Message:
add example php script, needed for testing php, which we will using the php cli


--- NEW FILE: monetdb.php ---
<?
if (!extension_loaded('monetdb')) {
        $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
        // note: PHP5 says it deprecates this, but I can't find
        //       how to make PHP5 happy...
        dl($prefix.'monetdb.'.PHP_SHLIB_SUFFIX) or
                die("Unable to load monetdb module!");
}
$db = monetdb_connect("sql", "localhost", 50000, "monetdb", "monetdb");
$tables = monetdb_query('SELECT name FROM tables');

for ($i = 0; $line = @monetdb_fetch_assoc($tables); $i++) {
        print($line['name']."\n");
}
$result = monetdb_query('SELECT * FROM tables');
$cols = monetdb_num_fields($result);
for ($i = 0; $i < $cols; $i++) {
        print(monetdb_field_name($result, $i)."\t");
}
print("\n");
while ($row = @monetdb_fetch_row($result)) {
        for ($i = 0; $i < $cols; $i++) {
                print($row[$i]."\t");
        }
        print("\n");
}
?>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to