What are cookies in PHP?
PHP | What are cookies in PHP? A cookie is a small piece of information store by the browser on the client location and sent to the server with every request. It stores a limited amount …
What is the maximum size of a file that can be uploaded using PHP and how can we change this?
PHP | The maximum size of a file that can be uploaded using PHP The default maximum size of a file that can be uploaded using PHP is 2MB. upload_max_filesize = 2M; and we can …
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 can we optimize a table?
OPTIMIZE command is use for optimize a table. OPTIMIZE TABLE `users`
How can we increase the speed of a MySQL select query?
MySQL | Increase the speed of a MySQL select query For increasing the speed of a query we have to do a couple of things First of all instead of using select * from table1, use …
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 …
How can we know the number of days between two given dates using PHP?
Bellow code is used for the same $date1 = date(‘Y-m-d’); $date2 = ‘2006-08-15’; $days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24); echo $days;
How can we know the number of days between two given dates using MySQL?
DATEDIFF function is use for finding the number of days between two given dates using MySQL DATEDIFF(‘2018-03-07′,’2017-01-01’)
How can we find the number of rows in a result set using PHP?
PHP | Find the number of rows in a result set Bellow code is use for the same $sql = "SELECT * FROM table1"; $result = mysql_query($sql, $db_link); $num_rows = mysql_num_rows($result); echo $num_rows;
How can we find the number of rows in a table using MySQL?
MySQL | Find the number of rows in a table We can use the below query to count the number of rows in a table >SELECT COUNT(*) FROM table_name;
What are the predefined classes in PHP?
Predefined classes in PHP are: Directory stdClass __PHP_Incomplete_Class exception php_user_filter
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 …
What are the different storage engine present in MySQL?
There are 5 different types of storage engine present in MySql. MyISAM Heap Merge INNO DB ISAM MyISAM is the default storage engine for MySQL
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() …
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 …