Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 PHP Extension Manual » Cursor Functions » edb_jsonload |
edb_jsonload(<CursorHandle>, <ColumnName>, <RowKeyValues>) <CursorHandle> = Handle of cursor returned by edb_execute function <ColumnName> = Name of BLOB column from which to retrieve data <RowKeyValues> = String containing a semicolon-delimited list of key values
The BLOB column data as a string if successful, and FALSE if there are any errors
<?php // The following script connects to an ElevateDB // Server and database, prepares and executes a // direct table open, and then handles the incoming // Elevate Web Builder dataset requests for the // column definitions, rows, or BLOB data // // THIS IS JUST FOR ILLUSTRATIVE PURPOSES // // If you really need to use the ElevateDB PHP // Extension with Elevate Web Builder, please see // the Elevate Web Builder PHP DataSet Manager // included with Elevate Web Builder. It requires // much less coding, and handles the dataset JSON // transparently $con = edb_connect("type=remote;charset=Ansi;address=127.0.0.1;"+ "uid=Administrator;pwd=EDBDefault;database=Test"); if (!$con) { die("Could not connect: " . edb_errmsg()); } $cmd = edb_prepare($con,"customer",EDB_COMMAND_TABLE); $cursor = edb_execute($cmd); if (isset($_SERVER["HTTP_X_EWBUSER"]) and isset($_SERVER["HTTP_X_EWBPASSWORD"])) { $user = $_SERVER["HTTP_X_EWBUSER"]; $pwd = $_SERVER["HTTP_X_EWBPASSWORD"]; } else if (isset($_GET["user"]) and isset($_GET["password"])) { $user = $_GET["user"]; $pwd = $_GET["password"]; } else { $user = NULL; $pwd = NULL; } if ($_GET["method"]) { switch ($_GET["method"]) { case "columns": { $cols = edb_jsoncols($cursor); if ($cols) { header("Content-Type: application/json; charset=utf-8"); echo $cols; } else { die "Error retrieving dataset columns (" . edb_errmsg() . ")"; } break; } case "rows": { $rows = edb_jsonrows($cursor,$_SERVER["SCRIPT_NAME"],"customer",FALSE,$_GET,$user,$pwd); if ($rows) { header("Content-Type: application/json; charset=utf-8"); echo $rows; } else { die "Error retrieving dataset rows (" . edb_errmsg() . ")"; } break; } case "load": { $data = edb_jsonload($cursor,$_GET["column"],$_GET["row"]); $content_type = edb_jsonloadtype($cursor,$_GET["column"],$_GET["row"]); if ($content_type <> "") { header("Content-Type: " . $content_type); } echo $data; break; } } } else { die "Dataset method not specified"; } edb_disconnect($con); ?>
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |