Snippets Collections
$this->load->library("form_validation");
$this->form_validation->set_rules("username", "User name", "trim|required");
if($this->form_validation->run() === FALSE)
{
     //$this->view_data["errors"] = validation_errors();
}
else
{
     //codes to run on success validation here
}
$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
$this->db->query($sql, array(3, 'live', 'Rick')); // insert in ci
  $(document).ready(function() {

        $('#check').on('submit', function(e) {
            e.preventDefault();

            $('#sub').prop('disable', true)
            $('#sub').text('Checking');
            $.ajax({
                url: '/home/checkorderstatus',
                method: 'POST',
                contentType: false,
                processData: false,
                cache: false,
                data: new FormData(this),
                success: function(data) {
                    $('#success').slideDown('slow').html(data);

                }
            });


            $(document).ajaxComplete(function() {
                $('#sub').prop('disabled', false)
                $('#sub').html('<i class="fa fa-search"></i>')
                $('#check').trigger("reset");
            })

            setTimeout(function() {
                $('#success').hide('slow')
            }, 3000)
        })


    })
star

Thu Feb 24 2022 13:43:32 GMT+0000 (UTC)

#php #codeigniter #database #model
star

Thu Feb 24 2022 09:08:59 GMT+0000 (UTC)

#php #codeigniter #database #model
star

Thu Feb 24 2022 08:48:16 GMT+0000 (UTC) https://codeigniter.com/userguide3/database/query_builder.html

#php #codeigniter #database #model

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension