Some of the most important SQL commands.

SQL, Structured Query Language, is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data accurate and secure, and it helps maintain the integrity of databases, regardless of size. Most of the actions you need to perform on a database are done with SQL statements. SQL commands are grouped into four major categories depending on their functionality: Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control Language (TCL) Data Control Language (DCL) COMMANDS: SELECT SELECT column_name FROM table_name; SELECT statements are used to fetch data from a database ( extracts data from a database ). Every query will begin with SELECT. ...

January 24, 2019 · 2 min · Harshvardhan Malpani

How to use .htaccess to run all .html files as .php by using PHP handlers in Apache w/o CGI?

Sometimes an old site is built from plain .html files and you want to add a bit of PHP to them, such as a shared header, a contact form or a date, without renaming every page to .php and breaking existing links and search rankings. Apache can be told to send .html files through PHP with a single line in .htaccess. The tricky part is finding the right handler name, because it differs from server to server and from one PHP version to another. ...

January 23, 2019 · 4 min · Harshvardhan Malpani

How to push into master or any other branch after removing last n commits in git?

Sometimes commits land on master (or any other branch) on the remote that shouldn’t be there, and you want the remote branch to go back to an earlier commit. Git lets you do this by force-pushing a specific commit to the branch. It’s quick, but it rewrites the branch’s history for everyone who uses the repository, so read the warnings below before you run it on a shared branch. The steps git log to find out the commit you want to revert, and the good commit just before it. git push origin +daee17:master, where daee17 is the commit before the wrongly pushed commit. The + is for force push. Finally, use git push origin master to sync your local branch with your git repo. And that’s it. ...

January 21, 2019 · 5 min · Harshvardhan Malpani

How to setup / enable Directory index listing?

When a web browser is pointed to a directory on your website which does not have an index.html file in it, the files in that directory can be listed on a web page. That’s handy when you want to share a folder of downloads, documents or builds without making a web page for them. There are two ways to do it: upload a script such as Directory Lister, which gives you a nicer looking page, or turn on the web server’s own listing with one line in .htaccess. Both are covered below. ...

January 20, 2019 · 3 min · Harshvardhan Malpani

Creating a table in PhpMyAdmin Xampp server.

Hello People. In this post we will discuss that how you can create a table in phpmyadmin xampp server for your php project. Before creating a table first you must create a database, because without database you can not create a table. steps to create a table in phpmyadmin. Start your Xampp server and open the following link in your browser. localhost/phpmyadmin . Now click on the New button. ...

January 16, 2019 · 1 min · Harshvardhan Malpani

How to add color gradients in HTML text?

To fill text with a colour gradient instead of a single colour, you paint the gradient as the element’s background and then cut the background down to the shape of the letters. It takes three CSS lines and no images, and the text stays real text that can be selected, copied and read by screen readers and search engines. .gradient-text { background: linear-gradient(to bottom right,#f27990, #332b75); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } What each line does: background: linear-gradient(to bottom right, #f27990, #332b75) paints a gradient across the element’s box, from pink in the top-left corner to dark purple in the bottom-right corner. You can add more colours, separated by commas, or change the direction, for example to right. -webkit-background-clip: text clips the background to the text, so the gradient is only painted where there are letters. -webkit-text-fill-color: transparent makes the letters themselves transparent, so the gradient behind them shows through. Without it, the normal text colour would cover the gradient. To use it, add the class to any element, for example <h2 class="gradient-text">. The live example below uses the same three rules under the class name gradt, with slightly different colours (#f27370 to #442b75). ...

January 15, 2019 · 2 min · Harshvardhan Malpani

5 ways to redirect your Web page?

Hi Everyone! In this post we will be learning about redirects. And see how you can redirect your web-page. We will see two ways to redirect web-pages: Through your registrars’ Cpanel. Right into your code. Through cPanel redirect feature You can easily redirect your visitors from one page to another with the help of the Redirects feature. To setup a redirection, access your website’s Control Panel and locate the Redirects menu. ...

January 12, 2019 · 2 min · Harshvardhan Malpani

Connection timeout with MySQL database.

MySQL disconnects automatically after some time. If a connection sits idle for longer than the server allows, MySQL closes it. The next query your code sends on that connection then fails, typically with “MySQL server has gone away” (error 2006) or “Lost connection to MySQL server during query” (error 2013). Long-running scripts, cron jobs and background workers that open one connection and keep it are the usual victims. If you experience MySQL timeouts, it could be due to heavy or very long MySQL queries. ...

January 8, 2019 · 3 min · Harshvardhan Malpani

How to hide a specific category from Google Index in Magento 2?

Some categories shouldn’t show up in Google: a hidden category for a landing page, a staging or test category, or one with thin or duplicate content. Magento 2 lets you set a default robots value for a whole store, but not for a single category. You can still do it without touching code, by adding a robots meta tag to that category’s layout from the admin. In Magento Admin Panel, Go to Catalog in Left Menu > Categories Select the category you want to edit and in Design Section > Layout Update XML, put this value: ...

January 7, 2019 · 2 min · Harshvardhan Malpani

ReactJS: Create your first react app.

React is one of the most in-demand and popular JavaScript library. And the reason is simple it gives you the ability to create complex User Interfaces with minimal and simplified code. In this article we are going to go through the installation process and the process of creating your first react app. Creating a react js app. There are a few different ways of creating a react app. But the simplest way is using a CDN – link. This allows you to start using ReactJS instantly, without any installation setup. ...

January 4, 2019 · 2 min · Harshvardhan Malpani