Prevent page caching in php using header() function
PHP | header() function By sending the headers bellow, we change the browser’s default cache settings. We can override any of those settings and force the browser to not cache. In this code we just …
What are triggers in Mysql?
Mysql | Trigger The trigger can be defined as a database object just like a stored procedure. It is a set of actions that fires automatically when an event occurs in a database. Triggers …
How we can check data type of any variable in php ?
PHP | Check data type in php | gettype() | var_dump() By using gettype() function we can check the data type of a variable. we can also use var_dump() function for the same. gettype() <?php echo …
Django order_by query set
Django | order_by query set, ascending and descending order_by() The order_by function is used to sort the result-set in ascending or descending order. Ascending Order The order_by function sorts the records in ascending order by …
What is robots.txt file?
Googlebot | What is a robots.txt file? A robots.txt is a simple text file that can be created by a notepad editor. This file is used for search engines, which provide instructions to search engines on how …
How can we find or count number of elements in an array?
PHP | Count number of elements in an array There are two ways to find the number of elements in an array: 1. sizeof($arr), This function is an alias of count() echo sizeof($arr); 2. count($arr) echo …
How can we increase the execution time of a PHP script?
PHP | max_execution_time directive in php.ini file By changing the value of max_execution_time in the php.ini file max_execution_time = 30; // in second By default, the maximum execution time for PHP scripts is set to …
How to convert a string to array ?
PHP | How to convert a string to an array? string to array There is a function in PHP called explode() which is used to convert any string to an array. <?php $str = …
Find nth largest salary from employees table?
By using following query we can find out the nth largest salary from employees table. SELECT salary FROM `employees` ORDER BY salary DESC LIMIT 1 OFFSET n-1 In the above query n is replaced by …
Compare timestamp with date only
SQL | Compare timestamp with date only Timestamp holds Date and Time both with 19 characters. To filter table record with the only date parameter can be achieved by SQL DATE() function. Consider the Employee table …
What are superglobal/global variables ?
PHP | What are superglobal/global variables? Superglobal is out of scope limitation. These variables can be accessed from any function, class, or file without doing anything special such as declaring any global variable, etc. These …
How to convert an array to string ?
PHP | How to convert an array to a string? array to string By using implode function we can convert any array to string. In implode function first parameter is separator which specifies what to …
How we can increase default timeout of session ?
PHP | Increase default session timeout The "session.gc_maxlifetime" is use to modify the default timout of session. server should keep session data for AT LEAST 1 hour by using the below code. It increase session …
How to get html attribute's value in jquery?
Jquery | attr | Get HTML attribute's value You can get the value of an attribute for the first element in the set of matched elements using the .attr() function. Return the value of …
How to upload file in PHP?
PHP | Upload File By using move_uploaded_file() function we can upload file in PHP.The move_uploaded_file() function moves an uploaded file to a new location. This function returns TRUE on success or FALSE on failure. move_uploaded_file(file,newloc) …