carbonPHP Initial commit v2.0
[carbonphp.git] / Documentation / database / function_calls.html
blobd9becd1af6722093f59523bb2a726420075d1c2b
1 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <head>
3 <title>CarbonPHP Documentation</title>
4 <style type="text/css">
5 * {
6 margin: 0;
7 padding: 0;
10 html {
11 font-family: "Lucida Sans Unicode", "Lucida Grande";
12 font-size: 12px;
15 body {
16 background: #fff;
17 color: #666;
20 h1 {
21 font-size: 15px;
22 font-weight: bold;
23 margin: 0 0 5px 0;
26 h2 {
27 font-size: 13px;
28 font-weight: bold;
29 margin: 5px 0 5px 0;
32 ol, ul {
33 margin: 10px 0 10px 0;
34 list-style-position: inside;
37 p {
38 margin: 5px 0 5px 0;
41 .content {
42 border: 1px dotted #444;
43 margin: 10px;
44 padding: 10px;
45 text-align: justify;
46 width: 700px;
49 .example {
50 border: 1px solid #ccc;
51 background: #eee;
52 margin: 10px;
53 padding: 10px;
54 text-align: left;
56 </style>
57 </head>
59 <body>
60 <div class="content">
61 <h1>Custom Function Calls</h1>
63 <p>CarbonPHP provides a method that allows you to manually call a database function that are not implemented
64 in the CarbonPHP database classes. For example if you wish to call the MySQL function
65 <b>mysql_get_client_info()</b> which is not implemented in CarbonPHP you can do so using the following
66 method.</p>
68 <div class="example">
69 $this->db->call_function('<b>get_client_info</b>');
70 </div>
72 <p>You have to supply the function name without the <b>mysql_</b> prefix as CarbonPHP will automatically
73 prepend this to the function call based on the database driver being used.</p>
75 <p>If you need to pass parameters to the function you can add them by passing them as a second parameter and
76 onwards.</p>
78 <div class="example">
79 $this->db->call_function('some_function', $param1, $param2, ...);
80 </div>
82 <p>You may also need to pass the result ID or connection ID to the function, these can be access by doing the
83 following.</p>
85 <div class="example">
86 $this->db->conn_id;
87 </div>
89 <p>The result ID can be accessed by doing the following.</p>
91 <div class="example">
92 $query = $this->db->query('SQL QUERY');<br />
93 <br />
94 <b>$query->result_id;</b>
95 </div>
96 </div>
97 </body>
99 </html>