1) Load the library at __construct() function as follow:
function __construct() {
parent::__construct();
$this->load->library('grocery_CRUD');
}
2) Try the code at examples.php but modified to suit my needs:
public function search() {
try {
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('tr007_usuarios');
$crud->set_subject('Propietarios');
$crud->columns('codigo', 'cedula', 'nb_usuario');
$output = $crud->render();
} catch (Exception $e) {
show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
}
$this->load->view('users/search', $output);
}
3) Print the $output at the template
echo $output;
But get this error
[quote]
[b] A Database Error Occurred[/b]
Error Number:
ERROR: syntax error at or near "FROM" LINE 1: SHOW COLUMNS FROM tr007_usuarios ^
SHOW COLUMNS FROM tr007_usuarios
Filename: /var/www/html/sic-auto-gas/models/grocery_crud_model.php
Line Number: 302
[/quote]
Any help?