There is an error came out something like this
Warning Error: Unlink Operation not Permitted
To solve this: edit application/config/config.php and set the following
$config[‘sess_save_path’] = BASEPATH . ‘cache/’;
There is an error came out something like this
Warning Error: Unlink Operation not Permitted
To solve this: edit application/config/config.php and set the following
$config[‘sess_save_path’] = BASEPATH . ‘cache/’;
2 simple steps.
1. Create or update the .htaccess as follow
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] OR RewriteEngine On RewriteBase /app/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /app/index.php [L] OR RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] ErrorDocument 404 /index.php
2. Update the config/config.php file to this
$config[‘index_page’] = ”;
Sample insert
$data = array( 'title' => $title, 'name' => $name, 'date' => $date ); $this->db->insert('mytable', $data);
Sample update
$this->db->update('mytable', $data, "id = 4"); OR $this->db->update('mytable', $data, array('id' => $id));
Sample delete
$this->db->delete('mytable', array('id' => $id));
Sample to get data
$where = "name='Joe' AND status='boss' OR status='active'"; $this->db->where($where);
1. All result set
$query = $this->db->query("YOUR QUERY"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { echo $row->title; echo $row->name; echo $row->body; } }
2. Just one row
$query = $this->db->query("YOUR QUERY");
if ($query->num_rows() > 0)
{
$row = $query->row();
echo $row->title;
echo $row->name;
echo $row->body;
}