<?php
class demo_model extends Model {
var $title = '';
var $content = '';
var $date = '';
function apidemo_modelmodel() {
// Call the Model constructor for PHP4
parent::Model ();
$DB1 = $this->load->database('default', TRUE);
$DB2 = $this->load->database('baike', TRUE);
}
//获取
function get_baike_info($id) {
$query = $DB2->query ( "SELECT * FROM web_baike " );
return $query->row_array ();
}
//获取
function get_information_info($id) {
$query = $DB1->query ( "SELECT * FROM web_information " );
return $query->row_array ();
}
}
/* End of file api_model.php */
/* Location: /application/models/demo_model.php */