Update of /cvsroot/monetdb/clients/src/examples/php
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3652/src/examples/php
Added Files:
Tag: Clients_1-20
Makefile.ag sqlsample.php
Removed Files:
Tag: Clients_1-20
monetdb.php
Log Message:
renamed monetdb.php into sqlsample.php (inline with python/perl)
added makefile to install it
--- NEW FILE: Makefile.ag ---
# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the MonetDB Database System.
#
# The Initial Developer of the Original Code is CWI.
# Portions created by CWI are Copyright (C) 1997-2007 CWI.
# All Rights Reserved.
MTSAFE
scripts_php = {
DIR = libdir/MonetDB/Tests
SOURCES = sqlsample.php
}
--- monetdb.php DELETED ---
--- NEW FILE: sqlsample.php ---
#!/usr/bin/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", $argv[1], "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