![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 PHP Extension Manual » Cursor Functions » edb_jsonrows |
edb_jsonrows(<CursorHandle>, <ResourceName>,
<DataSetName>, [<LocalizedDateTimeColumns>],
[<DataSetParams>], [<UserName>, <Password>])
<CursorHandle> =
Handle of cursor returned by edb_execute function
<ResourceName> =
String containing resource name to use for embedded BLOB URLs
<DataSetName> =
String containing dataset name to use for embedded BLOB URLs
<LocalizedDateTimeColumns> =
Boolean indicating whether to convert date/time columns to UTC time
<DataSetParams> =
String containing ampersand-delimited (&) list of dataset parameters to use for embedded BLOB URLs
<UserName> =
String containing user name to use for embedded BLOB URLs
<Password> =
String containing password to use for embedded BLOB URLsThe cursor rows as a JSON string if successful, and FALSE if there are any errors
dataset=<DataSetName>
<ResourceName>load?dataset=<DataSetName>&col=<ColumnName>&row=<RowKey>
<?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 Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

