<html>
<head>
<title>Sample Usage</title>
</head>
<body bgcolor="white">
<h1>Sample Usage of sql.php</h1>
<h2>A Quick Start</h2>
<p>1. Include the code in you page</p>
<pre>
require("sql.php");
</pre>
<p>2a. Run a "quick" query which will handle all the open and closing of the database connections for you.</p>
<pre>
$result = database_quick_query($datasource_mysql, "select * from test");
</pre>
<p>or</p>
<p>2b. Manage your own connections and run querys</p>
<pre>
$connection = database_connect($datasource_pg);
$result = database_query($connection, "select * from test");
database_close($connection);
</pre>
<p>3. Do something with the results</p>
<pre>
database_result_dump($result);
</pre>
<p>That's it!</p>
<hr />
<p>If you have configured your datasource_config.php file already, you may actually see a result set below:</p>
<?php
require("sql.php");
$result = @database_quick_query($datasource_mysql, "select * from test");
@database_result_dump($result);
?>
</body>
</html>
|