if (isset($_POST['search']) && !empty($_POST['search'])) {
$builder->like('name',$_POST['search']);
<?php namespace AppDatabaseMigrations;
use CodeIgniterDatabaseMigration;
class CreateUsersTable extends Migration
{
public function up() {
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'name' => [
'type' => 'VARCHAR',
'constraint' => '100',
],
'email' => [
'type' => 'VARCHAR',
'constraint' => '100',
],
'city' => [
'type' => 'VARCHAR',
'constraint' => '100',
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('users');
}
//--------------------------------------------------------------------
public function down() {
$this->forge->dropTable('users');
}
}