codeigniter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
codeigniter [2010/06/16 20:42] – javascript json array rfile | codeigniter [2011/03/07 21:09] (current) – rfile | ||
---|---|---|---|
Line 142: | Line 142: | ||
</ | </ | ||
+ | </ | ||
+ | <box|use of row_array()> | ||
+ | <code php> | ||
+ | /** | ||
+ | * Note the use of row_array to get | ||
+ | * array of one row instead of object | ||
+ | * this will matter later in the whole | ||
+ | * array that is passed to the view | ||
+ | * @param string $wfield | ||
+ | * the column we want to average | ||
+ | * @param string $avgname | ||
+ | * this is for the " | ||
+ | * @param string $tablename | ||
+ | * the name of the table the column is in | ||
+ | * @return array | ||
+ | * | ||
+ | */ | ||
+ | function get_avg($wfield, | ||
+ | $this-> | ||
+ | $query = $this-> | ||
+ | $avgdata = $query-> | ||
+ | return $avgdata ; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | </ | ||
+ | </ | ||
+ | <box | second database> | ||
+ | <code php> | ||
+ | |||
+ | <?php | ||
+ | class Model_old_info extends CI_Controller { | ||
+ | |||
+ | | ||
+ | { | ||
+ | parent:: | ||
+ | // Your own constructor code | ||
+ | $CI =& get_instance() ; | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | return $table_data; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ' | ||
+ | |||
+ | |||
</ | </ | ||
Line 148: | Line 210: | ||
< | < | ||
<code javascript> | <code javascript> | ||
- | $(document).ready(function() { | + | $(function() { |
$('# | $('# | ||
var wpt = $(' | var wpt = $(' |
codeigniter.1276738967.txt.gz · Last modified: 2010/06/16 20:42 by rfile