For cache management in Magento 2, login to Magento 2 server. Change your directory to <Magento 2 install directory>/bin. Type the below command to know the status of the cache
php magento cache:status
You will get result list. You woul ...
In Magento, often we need to add blocks in cms page, for example home page we need feature products, new products etc. So this post is about how we can add static in cms page. There is small code that we need to add in our cms page. As in example, ...
In Magento 2, for cron setup login to your magento 2 server. Change your directory to <Magento 2 install directory>/bin . Now run the following command.
php magento cron:run
The above command will set crons for reindexes indexers, sen ...
For managing indexers in magento 2 through cli, you need to login your server. Make sure you have write file permissions.Now change your directory to <Magento insall dir>/bin. For example your magento 2 is installed in
/var/www/html then you n ...
What is php ?
PHP stands for Hypertext Preprocessor. Its old full form was Personal Home Page. Php is an open source, server side scripting language, primarily used for web development. Php code could be executed with command line (CLI).
How vari ...
There may be duplicate values in column of table.But we may want to only distinct values from that column. This kind of requirement is fulfilled by DISTINCT.
Syntax is as:
SELECT DISTINCT(column_name) FROM table_name
Here, this is a php class for manipulating mysql database and executing queries. For beginners this very useful. Include this file in your project and call this class by creating object. Here is class :
There are some occasions, when we need a random string. For example when we want to generate password or we want to send verification code or captcha code etc. For generating random string with php, we shall make a function getRandom(), you may use a ...
For calculating difference between two dates in php we are make two functions, getDiff and its helping function daysInMonth,getDiff returns difference in array and daysInMonth returns days in month of given year and they are as follow: