Changeset 136

Show
Ignore:
Timestamp:
05/31/2007 11:29:35 AM (18 months ago)
Author:
Shadowhand
Message:

Fixing the docs for #33

Changed files:
user_guide/database/active_record.html

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/user_guide/database/active_record.html

    r29 r136  
    8787</ul> 
    8888 
    89  
    90  
    91  
    9289<a name="select">&nbsp;</a> 
    9390<h1>Selecting Data</h1> 
     
    9794<p><strong>Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.</strong></p> 
    9895 
    99  
    10096<h2>$this->db->get();</h2> 
    10197 
     
    111107<br /> 
    112108// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)</code> 
    113  
    114  
    115109 
    116110<p>You'll notice that the above function is assigned to a variable named <kbd>$query</kbd>, which can be used to show the results:</p> 
     
    395389 
    396390 
    397  
    398          
     391<h2>$this->db->count_records();</h2> 
     392 
     393<p>Permits you to determine the number of rows in a particular query, without actually making the query. Submit the table name 
     394in the first parameter. Example:</p> 
     395 
     396<code>$this->db->where('<var>some_field</var>', 20);<br /> 
     397$this->db->count_records('<var>my_table</var>'); 
     398<br /> 
     399// Produces an integer, like 10</code> 
     400 
     401<p class="important"><strong>Note:</strong> This function differs from <kbd>count_all</kbd> in that it allows you to use 
     402<kbd>where</kbd> before counting the rows.</p> 
     403 
     404 
    399405<a name="insert">&nbsp;</a> 
    400406<h1>Inserting Data</h1>