Location: PHPKode > scripts > MySQLi Database > mysqli-database/MysqliDatabase.html
<html>
<head>
<title>Docs For Class MysqliDatabase</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">Utilities</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_Utilities.html" class="menu">class tree: Utilities</a> ]
		  [ <a href="../elementindex_Utilities.html" class="menu">index: Utilities</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_Utilities.html">Utilities</a><br />
            <br /><br />
                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../Utilities/_class_MysqliDatabase_php.html">		class.MysqliDatabase.php
		</a><br>
	  </div><br />

      
            <b>Classes:</b><br />
        <div class="package">
		    		<a href="../Utilities/MysqliDatabase.html">MysqliDatabase</a><br />
	    		<a href="../Utilities/MysqliResult.html">MysqliResult</a><br />
	  </div>

                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Class: MysqliDatabase</h1>
Source Location: /class.MysqliDatabase.php<br /><br />


<table width="100%" border="0">
<tr><td valign="top">

<h3><a href="#class_details">Class Overview</a></h3>
<pre>mysqli
   |
   --MysqliDatabase</pre><br />
<div class="description">A mysqli wrapper class. To be used by the db abstraction layer</div><br /><br />
<h4>Author(s):</h4>
<ul>
          <li>Costin Bereveanu</li>
            </ul>




        
    
<h4>Version:</h4>
<ul>
  <li>0.0.1</li>
</ul>


</td>

<td valign="top">
<h3><a href="#class_vars">Variables</a></h3>
<ul>
    <li><a href="../Utilities/MysqliDatabase.html#var$throw_exceptions">$throw_exceptions</a></li>
  </ul>
</td>


<td valign="top">
<h3><a href="#class_methods">Methods</a></h3>
<ul>
    <li><a href="../Utilities/MysqliDatabase.html#method__construct">__construct</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodlast_error_was">last_error_was</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery">query</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_affected">query_affected</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_all">query_all</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_one">query_one</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_page">query_page</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_page_all">query_page_all</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_page_one">query_page_one</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_total">query_total</a></li>
    <li><a href="../Utilities/MysqliDatabase.html#methodquery_value">query_value</a></li>
  </ul>
</td>

</tr></table>
<hr />

<table width="100%" border="0"><tr>






</tr></table>
<hr />

<a name="class_details"></a>
<h3>Class Details</h3>
<div class="tags">
[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a382">382</a>]<br />
A mysqli wrapper class. To be used by the db abstraction layer<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>author:</b>&nbsp;&nbsp;</td><td>Costin Bereveanu</td>
  </tr>
  <tr>
    <td><b>version:</b>&nbsp;&nbsp;</td><td>0.0.1</td>
  </tr>
</table>
</div>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />

<hr />
<a name="class_vars"></a>
<h3>Class Variables</h3>
<div class="tags">
	<a name="var$throw_exceptions"></a>
	<p></p>
	<h4>$throw_exceptions = <span class="value">&nbsp;true</span></h4>
	<p>[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a384">384</a>]</p>
  <br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>

  <br />
	<div class="tags">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><b>Type:</b>&nbsp;&nbsp;</td>
      <td>mixed</td>
    </tr>
      </table>
	</div><br /><br />
	<div class="top">[ <a href="#top">Top</a> ]</div><br />
</div><br />

<hr />
<a name="class_methods"></a>
<h3>Class Methods</h3>
<div class="tags">
  <hr />
	<a name="method__construct"></a>
	<h3>constructor __construct <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a394">394</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>MysqliDatabase __construct(
string
$ConnectionString, [bool
$ThrowExceptions = true])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Modified constructor that accepts a connection string as its input<br /><br /><p>Format: &quot;server=...; database=...; username=...; password=...; port=...; socket=...&quot;  Each parameter is optional  Please note the existance of the connect_errno and connect_error mysqli member variables, not declared in the PHP documentation. They will hold the last connect error</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$ConnectionString</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">bool&nbsp;&nbsp;</td>
        <td><b>$ThrowExceptions</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodlast_error_was"></a>
	<h3>method last_error_was <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a510">510</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>bool last_error_was(
int
$ErrorCode)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Returns true if the last error code is equal to that given or false otherwise. You may use the constants given<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$ErrorCode</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery"></a>
	<h3>method query <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a424">424</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query(
string
$Query)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Sends a query to the database<br /><br /><p>Adds exception throwing</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_affected"></a>
	<h3>method query_affected <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a499">499</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int query_affected(
string
$Query)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Send out a query and return the number of affected rows<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>The number of affected rows</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_all"></a>
	<h3>method query_all <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a461">461</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_all(
string
$Query)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Send out a query and return all the rows<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>NULL if there are no rows, array of objects otherwise</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_one"></a>
	<h3>method query_one <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a449">449</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_one(
string
$Query)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Send a query and returns the first result row<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>NULL if there are no rows, object otherwise</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_page"></a>
	<h3>method query_page <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a522">522</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_page(
string
$Query, int
$RecordsPerPage, int
$Page)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Runs a paginated query - returns the specified page of results<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$RecordsPerPage</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$Page</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_page_all"></a>
	<h3>method query_page_all <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a539">539</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_page_all(
string
$Query, int
$RecordsPerPage, int
$Page)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Runs a paginated query and fetches all result rows<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>array or NULL if error</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$RecordsPerPage</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$Page</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_page_one"></a>
	<h3>method query_page_one <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a559">559</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_page_one(
string
$Query, int
$RecordsPerPage, int
$Page)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Runs a paginated query and fetches only the first result row<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>object or NULL if error</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$RecordsPerPage</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">int&nbsp;&nbsp;</td>
        <td><b>$Page</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_total"></a>
	<h3>method query_total <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a570">570</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>int query_total(
)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Returns the total number of rows in the last paginated query. DO NOT run unless a paginated query has been ran previously. It will just return 0<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodquery_value"></a>
	<h3>method query_value <span class="smalllinenumber">[line <a href="..//__filesource/fsource_Utilities__class.MysqliDatabase.php.html#a480">480</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>mixed query_value(
string
$Query, string
$Type)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		Send out a query and return the first field of the first result row, cast to the given type<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>return:</b>&nbsp;&nbsp;</td><td>NULL if there are no rows, $Type otherwise</td>
  </tr>
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />


        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Query</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
          <tr>
        <td class="type">string&nbsp;&nbsp;</td>
        <td><b>$Type</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
</div><br />


        <div class="credit">
		    <hr />
		    Documentation generated on Sat, 11 Jun 2005 02:53:47 +0300 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: MySQLi Database