simple-oai-pmh/doc/classDB__OP.html

441 lines
19 KiB
HTML
Raw Normal View History

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Data Centre: DB_OP Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<img id="MSearchSelect" src="search/search.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</div>
</li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>DB_OP Class Reference</h1><!-- doxytag: class="DB_OP" -->
<p>A wrapper class of normally used PostgreSQL operations.
<a href="#_details">More...</a></p>
<p><a href="classDB__OP-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a8afa9e38b71646599d9818927c4c5b23">__construct</a> ($params)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a1e3b490d94ec31bc015e7c3d2b26fb90">reconnect</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a9bf92eeb06136d45eb9fabe7ebffa8d1">affected_rows</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a35b709f19634cb9724935fb06b06c107">select</a> ($table, $select=array('*'))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#af861f2597dbcc3eebd07ca2949e25a64">simple_query</a> ($sql)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a903f5ae8b47ebd1062d44df3eb1e1120">query</a> ($sql, $return_object=FALSE)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#adecf1b0779b6b13a0bbe43ba87e021dc">load_rdriver</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a8450881d74aa3ddcb782878f77f89d1b">close</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a4cfe635c1a26b220956fbd5c9b8fe84c">display_error</a> ($error= '', $swap= '', $native=FALSE)</td></tr>
<tr><td colspan="2"><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#a13cae080cf2fc68efebd5a98f2145fd0">initialize</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#ac2e572e5709003ec71938999f59f1ff7">_connect_string</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#aedfc306defd0074b76e86470a6e4892f">db_connect</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#af5a792b6f306b8a5c9e1f74a28cd9d40">db_pconnect</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDB__OP.html#ac5d4ba1db4ee1e4831d7e27896fa9633">_error_message</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This class is used to construct database connection to a PostgreSQL database. It also includes some basic operation to database. This can be a template for future development of connecting to other databases </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8afa9e38b71646599d9818927c4c5b23"></a><!-- doxytag: member="DB_OP::__construct" ref="a8afa9e38b71646599d9818927c4c5b23" args="($params)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::__construct </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>params</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor. Accepts one parameter containing the database connection settings.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>array</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a13cae080cf2fc68efebd5a98f2145fd0"></a><!-- doxytag: member="DB_OP::initialize" ref="a13cae080cf2fc68efebd5a98f2145fd0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::initialize </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize Database Settings. Called by the constructor.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>void</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>boolean. TRUE for successful initialisation. FALSE otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="ac2e572e5709003ec71938999f59f1ff7"></a><!-- doxytag: member="DB_OP::_connect_string" ref="ac2e572e5709003ec71938999f59f1ff7" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::_connect_string </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Construct connection string</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl>
</div>
</div>
<a class="anchor" id="aedfc306defd0074b76e86470a6e4892f"></a><!-- doxytag: member="DB_OP::db_connect" ref="aedfc306defd0074b76e86470a6e4892f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::db_connect </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Non-persistent database connection</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>resource </dd></dl>
</div>
</div>
<a class="anchor" id="af5a792b6f306b8a5c9e1f74a28cd9d40"></a><!-- doxytag: member="DB_OP::db_pconnect" ref="af5a792b6f306b8a5c9e1f74a28cd9d40" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::db_pconnect </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Persistent database connection</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>resource </dd></dl>
</div>
</div>
<a class="anchor" id="a1e3b490d94ec31bc015e7c3d2b26fb90"></a><!-- doxytag: member="DB_OP::reconnect" ref="a1e3b490d94ec31bc015e7c3d2b26fb90" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::reconnect </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reconnect</p>
<p>Keep / reestablish the db connection if no queries have been sent for a length of time exceeding the server's idle timeout</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>void </dd></dl>
</div>
</div>
<a class="anchor" id="a9bf92eeb06136d45eb9fabe7ebffa8d1"></a><!-- doxytag: member="DB_OP::affected_rows" ref="a9bf92eeb06136d45eb9fabe7ebffa8d1" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::affected_rows </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Affected Rows</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>integer </dd></dl>
</div>
</div>
<a class="anchor" id="a35b709f19634cb9724935fb06b06c107"></a><!-- doxytag: member="DB_OP::select" ref="a35b709f19634cb9724935fb06b06c107" args="($table, $select=array('*'))" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::select </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>select</em> = <code>array('*')</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Generates the SELECT portion of the query when multiple fileds are needed</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$table</em>&nbsp;</td><td>Type: string. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$select</em>&nbsp;</td><td>Type: array. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl>
</div>
</div>
<a class="anchor" id="af861f2597dbcc3eebd07ca2949e25a64"></a><!-- doxytag: member="DB_OP::simple_query" ref="af861f2597dbcc3eebd07ca2949e25a64" args="($sql)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::simple_query </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>sql</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Simple Query This function is used for client script will process result. Or running transaction commands since they do not require all the features of the main <a class="el" href="classDB__OP.html#a903f5ae8b47ebd1062d44df3eb1e1120">query()</a> function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td>the sql query </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>resource </dd></dl>
</div>
</div>
<a class="anchor" id="a903f5ae8b47ebd1062d44df3eb1e1120"></a><!-- doxytag: member="DB_OP::query" ref="a903f5ae8b47ebd1062d44df3eb1e1120" args="($sql, $return_object=FALSE)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::query </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>sql</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>return_object</em> = <code>FALSE</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Execute the query</p>
<p>Accepts an SQL string as input and returns a result object upon successful execution of a "read" type query. Returns boolean TRUE upon successful execution of a "write" type query. Returns boolean FALSE upon failure.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td>An SQL query string </td></tr>
<tr><td valign="top"></td><td valign="top"><em>array</em>&nbsp;</td><td>An array of binding data </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>mixed </dd></dl>
</div>
</div>
<a class="anchor" id="adecf1b0779b6b13a0bbe43ba87e021dc"></a><!-- doxytag: member="DB_OP::load_rdriver" ref="adecf1b0779b6b13a0bbe43ba87e021dc" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::load_rdriver </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Load the result drivers</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>string the name of the result class </dd></dl>
</div>
</div>
<a class="anchor" id="a8450881d74aa3ddcb782878f77f89d1b"></a><!-- doxytag: member="DB_OP::close" ref="a8450881d74aa3ddcb782878f77f89d1b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::close </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Close database connection</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>void </dd></dl>
</div>
</div>
<a class="anchor" id="ac5d4ba1db4ee1e4831d7e27896fa9633"></a><!-- doxytag: member="DB_OP::_error_message" ref="ac5d4ba1db4ee1e4831d7e27896fa9633" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::_error_message </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The error message string</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>string </dd></dl>
</div>
</div>
<a class="anchor" id="a4cfe635c1a26b220956fbd5c9b8fe84c"></a><!-- doxytag: member="DB_OP::display_error" ref="a4cfe635c1a26b220956fbd5c9b8fe84c" args="($error= '', $swap= '', $native=FALSE)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DB_OP::display_error </td>
<td>(</td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>error</em> = <code>''</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>swap</em> = <code>''</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&nbsp;</td>
<td class="paramname"> <em>native</em> = <code>FALSE</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Display an error message in some format</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td>the error message </td></tr>
<tr><td valign="top"></td><td valign="top"><em>string</em>&nbsp;</td><td>any "swap" values </td></tr>
<tr><td valign="top"></td><td valign="top"><em>boolean</em>&nbsp;</td><td>whether to localize the message </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>string sends the application/error_db.php template </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>db_comm.php</li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri May 27 09:42:03 2011 for Data Centre by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>