aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/mirror/lib/_php_lib_db_php.html')
-rw-r--r--docs/mirror/lib/_php_lib_db_php.html527
1 files changed, 527 insertions, 0 deletions
diff --git a/docs/mirror/lib/_php_lib_db_php.html b/docs/mirror/lib/_php_lib_db_php.html
new file mode 100644
index 0000000..5b8ddbd
--- /dev/null
+++ b/docs/mirror/lib/_php_lib_db_php.html
@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!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>
+ <!-- template designed by Marco Von Ballmoos -->
+ <title>Docs for page db.php</title>
+ <link rel="stylesheet" href="../../media/stylesheet.css" />
+ <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+ </head>
+ <body>
+ <div class="page-body">
+<h2 class="file-name">/php/lib/db.php</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+ <div class="info-box-title">Description</div>
+ <div class="nav-bar">
+ <span class="disabled">Description</span> |
+ <a href="#sec-functions">Functions</a>
+ </div>
+ <div class="info-box-body">
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Minimal wrappers for core PHP mysql_* functions.</p>
+
+ </div>
+</div>
+
+
+
+
+
+ <a name="sec-functions"></a>
+ <div class="info-box">
+ <div class="info-box-title">Functions</div>
+ <div class="nav-bar">
+ <a href="#sec-description">Description</a> |
+ <span class="disabled">Functions</span>
+ </div>
+ <div class="info-box-body">
+ <a name="functiondb_close" id="functiondb_close"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_close</span> (line <span class="line-number">258</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Close the db connection. If a dbh is not specified, assume the last opened link.</p>
+
+ <div class="method-signature">
+ <span class="method-result">void</span>
+ <span class="method-name">
+ db_close
+ </span>
+ ([<span class="var-type">resource</span>&nbsp;<span class="var-name">$dbh</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">resource</span>
+ <span class="var-name">$dbh</span><span class="var-description">: optional dbh to close</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_connect" id="functiondb_connect"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_connect</span> (line <span class="line-number">15</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Connect to a MySQL database server.</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> dbh</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">resource</span>
+ <span class="method-name">
+ db_connect
+ </span>
+ ([<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'localhost'</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$user</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$password</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$host</span><span class="var-description">: db server, defaults to localhost</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$user</span><span class="var-description">: db username</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$password</span><span class="var-description">: db password</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_fetch" id="functiondb_fetch"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_fetch</span> (line <span class="line-number">69</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Fetch a row as an array from a result.</p>
+
+ <div class="method-signature">
+ <span class="method-result">array</span>
+ <span class="method-name">
+ db_fetch
+ </span>
+ ([<span class="var-type">string</span>&nbsp;<span class="var-name">$result</span> = <span class="var-default">null</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">MYSQL_BOTH</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$result</span><span class="var-description">: (default to null)</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_fieldnames" id="functiondb_fieldnames"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_fieldnames</span> (line <span class="line-number">121</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Get all of the fieldnames for the specified table.</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> array of column names, must be an array</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">array</span>
+ <span class="method-name">
+ db_fieldnames
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span><span class="var-description">: name of table to describe</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_get" id="functiondb_get"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_get</span> (line <span class="line-number">96</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Fetch an array based on a query.</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> array of database rows Example of returned array: <pre><ol><code><pre><li> <a href="../../mirror/lib/_php_lib_db_php.html#functiondb_get">db_get</a><span class="src-sym">(</span><span class="src-str">&quot;SELECT * FROM table&quot;</span><span class="src-sym">,</span><span class="src-id">MYSQL_ASSOC</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
+<li> <span class="src-id">returns</span>...</li>
+<li> <span class="src-key">Array</span></li>
+<li> <span class="src-sym">(</span></li>
+<li> <span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">] </span>=&gt; <span class="src-key">Array</span></li>
+<li> <span class="src-sym">(</span></li>
+<li> <span class="src-sym">[</span><span class="src-id">id</span><span class="src-sym">] </span>=&gt; <span class="src-num">1</span></li>
+<li> <span class="src-sym">[</span><span class="src-id">field1</span><span class="src-sym">] </span>=&gt; <span class="src-id">data1</span></li>
+<li> <span class="src-sym">[</span><span class="src-id">field2</span><span class="src-sym">] </span>=&gt; <span class="src-id">data2</span></li>
+<li> <span class="src-sym">)</span></li>
+<li>&nbsp;</li>
+<li> <span class="src-sym">)</span></li>
+</pre></code></ol></pre></li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">array</span>
+ <span class="method-name">
+ db_get
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">MYSQL_BOTH</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$col_id</span> = <span class="var-default">NULL</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$query</span><span class="var-description">: database query</span> </li>
+ <li>
+ <span class="var-type">int</span>
+ <span class="var-name">$type</span><span class="var-description">: result type</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$col_id</span><span class="var-description">: if passed it, the values of this column in the result set will be used as the array keys in the returned array</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_get_one" id="functiondb_get_one"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_get_one</span> (line <span class="line-number">268</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Get one record.</p>
+
+ <div class="method-signature">
+ <span class="method-result">void</span>
+ <span class="method-name">
+ db_get_one
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$query</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">MYSQL_ASSOC</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$query</span><span class="var-description">: query</span> </li>
+ <li>
+ <span class="var-type">int</span>
+ <span class="var-name">$type</span><span class="var-description">: result type</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_insert_id" id="functiondb_insert_id"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_insert_id</span> (line <span class="line-number">237</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Since PHP's mysql_insert_id() sometimes throws an error, this is the replacement</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> the return value of MySQL's last_insert_id()</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">int</span>
+ <span class="method-name">
+ db_insert_id
+ </span>
+ ([<span class="var-type">resource</span>&nbsp;<span class="var-name">$dbh</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">resource</span>
+ <span class="var-name">$dbh</span><span class="var-description">: optional dbh to get the last inserted id from</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_makeinsert" id="functiondb_makeinsert"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_makeinsert</span> (line <span class="line-number">151</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Create a MySQL INSERT statement based on $_POST array generated by form submission.</p>
+<p class="description"><p><ul><li>does not work with mysql functions (PASSWORD, etc.) because there are forced double quotes</li><li>do not use clean_in() before this, or you'll have double the slashes</li><li>use the function only when it saves you time, not _always_</li><li>form items not set will not be processed (unchecked radios, checkboxes) - handle these manually, or don't use the func</li></ul></p></p>
+ <ul class="tags">
+ <li><span class="field">return:</span> resulting MySQL insert string</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">string</span>
+ <span class="method-name">
+ db_makeinsert
+ </span>
+ (<span class="var-type">array</span>&nbsp;<span class="var-name">$vars</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">array</span>
+ <span class="var-name">$vars</span><span class="var-description">: array of posts</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span><span class="var-description">: name of the table that fields will be inserted into</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_makereplace" id="functiondb_makereplace"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_makereplace</span> (line <span class="line-number">183</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Create a MySQL REPLACE statement based on $_POST array generated by form submission.</p>
+<p class="description"><p><ul><li>does not work with mysql functions (PASSWORD, etc.) because there are forced double quotes</li><li>do not use clean_in() before this, or you'll have double the slashes</li><li>use the function only when it saves you time, not _always_</li><li>form items not set will not be processed (unchecked radios, checkboxes) - handle these manually, or don't use the func</li></ul></p></p>
+ <ul class="tags">
+ <li><span class="field">return:</span> resulting MySQL insert string</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">string</span>
+ <span class="method-name">
+ db_makereplace
+ </span>
+ (<span class="var-type">array</span>&nbsp;<span class="var-name">$vars</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">array</span>
+ <span class="var-name">$vars</span><span class="var-description">: array of posts</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span><span class="var-description">: name of the table that fields will be inserted into</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_makeupdate" id="functiondb_makeupdate"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_makeupdate</span> (line <span class="line-number">215</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Create a MySQL UPDATE statement based on $_POST array generated by form submission.</p>
+<p class="description"><p><ul><li>does not work with mysql functions (PASSWORD, etc.) because there are forced double quotes</li><li>do not use clean_in() before this, or you'll have double the slashes</li><li>use the function only when it saves you time, not _always_</li><li>form items not set will not be processed (unchecked radios, checkboxes) - handle these manually, or don't use the func</li></ul></p></p>
+
+ <div class="method-signature">
+ <span class="method-result">void</span>
+ <span class="method-name">
+ db_makeupdate
+ </span>
+ (<span class="var-type">array</span>&nbsp;<span class="var-name">$vars</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$where</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">array</span>
+ <span class="var-name">$vars</span><span class="var-description">: array of posts</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span><span class="var-description">: name of the table that fields will be inserted into</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$where</span><span class="var-description">: where clause, describing which records are to be updated</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_name_to_id" id="functiondb_name_to_id"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_name_to_id</span> (line <span class="line-number">280</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Get an ID based on name.</p>
+
+ <div class="method-signature">
+ <span class="method-result">void</span>
+ <span class="method-name">
+ db_name_to_id
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$id_col</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name_col</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$id_col</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$name_col</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$name</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_numrows" id="functiondb_numrows"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_numrows</span> (line <span class="line-number">249</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Determine number of rows in result.</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> number of rows in query result</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">int</span>
+ <span class="method-name">
+ db_numrows
+ </span>
+ ([<span class="var-type">resource</span>&nbsp;<span class="var-name">$result</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">resource</span>
+ <span class="var-name">$result</span><span class="var-description">: mysql result</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_query" id="functiondb_query"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_query</span> (line <span class="line-number">48</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Execute a MySQL query.</p>
+
+ <div class="method-signature">
+ <span class="method-result">void</span>
+ <span class="method-name">
+ db_query
+ </span>
+ ([<span class="var-type">string</span>&nbsp;<span class="var-name">$qry</span> = <span class="var-default">null</span>], [<span class="var-type">resource</span>&nbsp;<span class="var-name">$dbh</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$qry</span><span class="var-description">: MySQL query</span> </li>
+ <li>
+ <span class="var-type">resource</span>
+ <span class="var-name">$dbh</span><span class="var-description">: valid dbh</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_select" id="functiondb_select"><!-- --></a>
+<div class="oddrow">
+
+ <div>
+ <span class="method-title">db_select</span> (line <span class="line-number">33</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Select database.</p>
+ <ul class="tags">
+ <li><span class="field">return:</span> success of command</li>
+ </ul>
+
+ <div class="method-signature">
+ <span class="method-result">bool</span>
+ <span class="method-name">
+ db_select
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$database</span>, [<span class="var-type">resource</span>&nbsp;<span class="var-name">$dbh</span> = <span class="var-default">null</span>])
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$database</span><span class="var-description">: name of the database to select</span> </li>
+ <li>
+ <span class="var-type">resource</span>
+ <span class="var-name">$dbh</span><span class="var-description">: valid dbh, null if not defined</span> </li>
+ </ul>
+
+
+</div>
+<a name="functiondb_toggle_bool" id="functiondb_toggle_bool"><!-- --></a>
+<div class="evenrow">
+
+ <div>
+ <span class="method-title">db_toggle_bool</span> (line <span class="line-number">294</span>)
+ </div>
+
+ <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets enum booleans to their opposite</p>
+
+ <div class="method-signature">
+ <span class="method-result">int</span>
+ <span class="method-name">
+ db_toggle_bool
+ </span>
+ (<span class="var-type">string</span>&nbsp;<span class="var-name">$table</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$pri</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$col</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$id</span>)
+ </div>
+
+ <ul class="parameters">
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$table</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$pri</span> </li>
+ <li>
+ <span class="var-type">string</span>
+ <span class="var-name">$col</span> </li>
+ <li>
+ <span class="var-type">array</span>
+ <span class="var-name">$id</span> </li>
+ </ul>
+
+
+</div>
+ </div>
+ </div>
+
+ <p class="notes" id="credit">
+ Documentation generated on Mon, 8 Nov 2004 13:43:03 -0800 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
+ </p>
+ </div></body>
+</html> \ No newline at end of file