![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 PHP Extension Manual » Getting Started » Sample Script |
<?php
// First connect to the database
$con = edb_connect("type=local;charset=Ansi;configpath=C:\\Tutorial;"+
"uid=Administrator;pwd=EDBDefault;database=Tutorial");
if (!$con)
{
die("Could not connect: " . edb_errmsg());
}
// Create a direct table open command
$cmd = edb_prepare($con,"customer",EDB_COMMAND_TABLE);
// Execute the command to get the table cursor
$cursor = edb_execute($cmd);
echo "<table border=\"1\" cellpadding=\"3\">";
echo "<tr>";
// Dump out the column headers
for ($i = 0; $i < edb_colcount($cursor); $i++)
{
$colinfo = edb_colinfo($cursor,$i);
echo "<td>" . $colinfo["Name"] . "</td>";
}
echo "</tr>";
// Now dump out the rows
while (!edb_eof($cursor)):
echo "<tr>";
for ($i = 0; $i < edb_colcount($cursor); $i++)
{
$col = edb_getcol($cursor,$i);
if (is_null($col))
echo "<td>NULL</td>";
else
echo "<td>" . $col . "</td>";
}
echo "</tr>";
edb_next($cursor);
endwhile;
echo "</table>";
?>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 ? |

