[eluser]GamingFusion[/eluser]
I have a page that needs to get data from the database and place it into fields but my function in the model i think isnt working right but i not sure what isn't working
Controller
Code:
function general()
{
$this->adminCheck();
$this->database->getFieldsAll('info');
if ($query)
{
$query = "SELECT * FROM info ";
$result = $this->db->query($query);
$check = $result->num_rows();
if ($check > 0)
{
$data['siteName'] = $this->input->post('sitename');
$data['siteUrl'] = $this->input->post('siteurl');
$data['adminEmail'] = $this->input->post('admine');
$data['welcome'] = $this->input->post('welcome');
}
}
//Set Data
$data['title'] = 'Theater 311 | General Settings';
$data['heading'] = 'General Settings';
$data['css'] = 'site';
$data['content'] = 'admin/general';
//Load View
$this->load->view('admin/template/index', $data);
}
model
Code:
function getFieldsAll($table)
{
$query = $this->db->get($table);
if ($query->num_rows == 1)
{
return true;
}
}