MySQL Code for adding days, time to date column

Use following code to update a date column in MySQL table. One can add days, hours and more depending on the requirement. A fix date can be provided (like 2023-06-20) to which days can be added, current date can be used to add days, existing date_column value can also be used to add days, based on other column value like serial number or some number can be added.

using fix date

UPDATE table_name SET date_column= ‘2023-06-20’ + INTERVAL 2 DAY + INTERVAL 19 HOUR;

using current date

UPDATE table_name SET date_column=CURDATE() + INTERVAL 2 DAY + INTERVAL 19 HOUR;

using column date

UPDATE table_name SET date_column= date_column + INTERVAL 2 DAY + INTERVAL 19 HOUR;

using column value

UPDATE table_name SET date_column= ‘2023-06-20’ + INTERVAL column_name DAY + INTERVAL 19 HOUR;

Online Shopping e-commerce implementation logic with coupons

Online shopping is gaining boom. More web companies/stores (webpanies) are opening up. Big companies/market place have coupons system and online payment system. Small, medium and large businesses are also coming online to sell products. They need a shopping cart mechanism along with payment system. Many CMS are available for integration with website along with payment … Read more

Custom notifications and alerts on mobile for Android, IOS

We get lot of notifications, alerts as message, sound and vibrations on our smartphone. These notifications are for a particular app. When app is configured to receive notifications and some update is there we receive an alert in form of message, popup, notification, vibration, light or sound. Like in case of popular Whatsapp app we … Read more

PHP bidirectional algorithm to find connection between linked users

This is the version (2.0) of our earlier post Find connection path between two users in a social network using PHP and http://blog.kunals.com/php-code-find-2-users-connected-friends-social-network/. In this version bidirectional search is performed from both ends/nodes/users and if found path is displayed. This is based on graph traversal, breadth first search (bfs), bi-directional bfs. Nodes are the users and … Read more

PHP code to find how 2 users are connected through friends in social network

This is the second version of our earlier post Find connection path between two users in a social network using PHP. In this version performance issues have been taken care upto some level along with minor tweaks to code to make it more efficient. Initialising start user, end user, maximum level/degree/depth [php] $user_from=1; //start user … Read more

Find connection path between two users in a social network using PHP

Social networking sites are coming up daily. Users are linked to other users based on various factors like friends, interests, groups, same school, same company, same locality and many more. In all these we are connected to people we know or upto next level that is friends of friends. A need has been identified to … Read more

Web Product Manager Sample Job Description

A sample Job Description for a profile of Web Product Manager. A JD should cover company profile, position, package, responsibilites, requirements, additional requirements and contact. Here is a sample Job Description: Company Profile: (Write a brief description about company and include what company does, where it is located etc.) Position: Product Manager (write position for … Read more