working on it ...

Filters

Explore Public Snippets

Sort by

Found 2 snippets

    public by NassimB  1899  0  5  0

    mysql user privileges / grant tables

    1.Create user in mysql.user
    2.UPDATE user SET Password=PASSWORD('password') WHERE User='user_name';
    3.FLUSH PRIVILEGES;
    4.GRANT ALL ON database.table TO user_name IDENTIFIED BY 'p@$$vvord';

    public by NassimB  1434  3  5  0

    codeigniter-pagination-url-with-get-parameters

    <?
    $this->load->library('pagination');
    		
    $item_per_page = 48;
    $total_rows = //query here for total num of items from model
    	
    // thanks to Aurel for the trick see http://stackoverflow.com/questions/5384644/codeigniter-pagination-url-with-get-parameters
    if (count($_GET) > 0) $config['suffix'] = '?' . http_build_query($_GET, '', "&");
    	
    $config['base_url']  = base_url().'/controller/method/';
    $config['first_url'] = $config['base_url'].'0?'.http_build_query($_GET);
    	
    $config['per_page']  = $item_per_page;
    $config['total_rows'] = $total_rows; 
    		
    $this->pagination->initialize($config);
    $data['pagination'] =  $this->pagination->create_links();
    	
    $offset = $this->uri->segment(3);
    if(!$offset) $offset = 0;
    $data['result'] = // query with offset and limit ($item_per_page)
    	
    //call view
    $this->load->view("view",$data)
    

    List Complete ( 2 snippets total )

    Cannot find what you were looking for?
    Ask the Snip2Code Community

    • Public Snippets
    • Channels Snippets