What is helpers in CodeIgniter and how to load helper file?
CodeIgniter | What is helpers | Load helper file Helper is simply a collection of function in a particular category which helps you with tasks. The helper file can be loaded in controller constructor, some …
Django migration error : TypeError expected string or bytes-like object
Django I Migrate Error: TypeError expected string or bytes-like object "TypeError: expected string or bytes-like object", says the value we have provided for updating the field for the model is not supported. So to resolve this issue …
What is the difference between BETWEEN and IN operator in SQL?
SQL | difference between BETWEEN and IN operator The BETWEEN operator selects all records between the given range whereas IN operator selects all matching records given with the WHERE clause. BETWEEN operator The Between operator in …
CodeIgniter where_in condition
Codeigniter | where_in The where_in() allows you to pass an array in the where clause. It generates a WHERE field IN ('item', 'item') SQL query. Syntax: $this->db->where('condition'); <?php $ids = array('1', '2', '3'); $this->db->from('users'); $this->db->where_in('id', …
What are the difference between mysqli_fetch_assoc and mysqli_fetch_array?
PHP-MYSQL | mysqli_fetch_assoc() VS mysqli_fetch_array() mysqli_fetch_assoc() function fetch a result row as an associative array where as mysqli_fetch_array() function fetch a result row as an associative array, a numeric array, or both. mysqli_fetch_assoc() The mysqli_fetch_assoc() …
How will you concatenate two strings in PHP?
PHP | Combine two strings There are several ways to concatenate two strings in PHP. Use the concatenation operator [.] and [.=] There are two string operators that are used for concatenation. [.]: Concatenation operator …
What is the difference between explode() and implode() function?
PHP | implode() and explode() function implode() function is use to convert an array into a string where as explode() function is used to convert an string into an array implode() The implode() function …
How to set or get config variables in Codeigniter?
Codeigniter | SET or GET config variables The config set_item() & item() functions are work for SET and GET a config variable in codeigniter In Codeigniter, by default, all config variables are located at the “application/config/config.php” …
How to set timezone in codeigniter?
Codeigniter | Set timezone To set default timezone in Codeigniter, you can add the date_default_timezone_set() function in your application/config.php or index.php file. date_default_timezone_set('your timezone'); <?php // India timezone date_default_timezone_set('Asia/Kolkata'); ?>
Jquery Auto Focus On Next Input Field
Jquery | Auto Focus On Next Input Field The jquery code for autofocus on the next text input field. $(".input-key").keyup(function() { if ($(this).val().length == $(this).attr("maxlength")) { $(this).next('.input-key').focus(); } }); Let's go through the above jquery …
What are the difference between mysqli_fetch_object and mysqli_fetch_array?
PHP-MYSQL | mysqli_fetch_object () VS mysqli_fetch_array() mysqli_fetch_object() fetch a result row as an object where as mysqli_fetch_array() fetch a result row as an associative array, a numeric array, or both. mysqli_fetch_object() The mysqli_fetch_object() function returns …
How to open pdf file to another tab in browser
HTML | Target attribute To open a pdf file we can use the target attribute of the anchor tag. The target attribute of the anchor tag specifies where to open the linked document. Syntex for using …
How to stop execution of PHP script ?
PHP | Stop the execution of php script | exit() funtion By using exit() function we can stop the execution of php script. <?php $a = 10; $b = 20; $c = $a+$b; exit(); …
What is the difference between $name and $$name?
$name and $$name both are variables but with a single difference that is $name is just a normal php variable where as $$name is known as reference variable. It allow you to use $name variable's …
Insert and Get data from an Elasticsearch index in python
Python | Insert and Get data from an index in Elasticsearch To do so we need to import the Elasticsearch package and create an instance of that by providing the host and port. >>> from elasticsearch …