How we can find last insert id in table?
MySQL | Find last insert id in the table By using the MySQL function mysqli_insert_id() we can retrieve the last inserted id in the database table. <?php $con = mysqli_connect("localhost","user_name","user_password","db_name"); if (mysqli_connect_errno()) { echo …
What do you mean by foreign key?
SQL | Foreign Key A foreign key is a key used to link two tables. A Primary key of a table is used as a foreign key for the other table. The primary key …
What is access specifiers in php?
PHP | Access specifiers An access specifier is a code element that is used to determine which part of the program is allowed to access a particular variable or other information. There are three …
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 …
How can we repair a MySQL table?
MySQL | Repair Table REPAIR command is used for repair a MySQL table REPAIR TABLE users We can also specify Quick and Extended after the table name REPAIR TABLE users QUICK If we specify Quick then MySQL will …
what are php magic fuction?
PHP | magic function In PHP all functions start with __ names are magical functions. Magical functions always live in a PHP class. The definition of the magical function is defined by the programmer itself. …
SQL Update statement
SQL Update statement The UPDATE statement is used to update the records of an existing table in a database. We can update single as well as multiple columns using SQL update statement. The basic syntax …
How to redirect a page in PHP?
PHP | Redirect PHP header() function is used to redirect a page to another page. It supplies raw HTTP headers to the browser and redirects it to another location. The redirection script should be at …
what is Cross-site scripting?
Cross-site scripting (XSS) Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications. XSS enables attackers to inject client-side script into web pages viewed by other users. A cross-site scripting …
How to avoid errors in PHP ?
PHP | How to avoid errors in PHP? We can use PHP inbuilt function error_reporting(0) to avoid all errors in PHP file. <?php error_reporting(0); ?>
what is list in php?
List List is a language construct and is similar to an array. It is used to assign a list of variables in one operation. If you are using PHP 5, then the list values start …
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 …
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 …
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 …
How to find current date and time in PHP?
PHP | date() function By using the PHP date() function we can find the current date and time. <?php echo date(“d-m-Y”); //This will print today date. echo date (“d-m-Y h:i:s”) // This will print today’s date …