Posts

Showing posts from February, 2017

Mysql query to get data last or next days

MySQL Query to select data from last week? PREVIOUS DAYS SELECT * FROM table WHERE date_field BETWEEN date_sub(now(),INTERVAL 1 WEEK) and now(); NEXT DAYS(TOMORROW OR +++) SELECT * FROM table WHERE date_filed BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 7 DAY); SELECT * FROM table WHERE date_filed  >= NOW() AND Product_exp_date <= NOW() + INTERVAL 7 DAY;

Converting string to Date and DateTime in PHP

Converting string to Date and DateTime Use strtotime() on your first date then date('Y-m-d') to convert it back: $time = strtotime('10/16/2003'); $newformat = date('Y-m-d',$time); echo $newformat; // 2003-10-16        Make note that there is a difference between using forward slash / and hyphen - in the strtotime() function. To quote from php.net:        Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

How to delete multiple rows in SQL

How to delete multiple rows in SQL where id = (x to y) If you need to delete based on a list, you can use IN: delete from your_table where id in (value1, value2, ...); If you need to delete based on the result of a query, you can also use IN: delete from your_table where id in (select aColumn from ...); (Notice that the subquery must return only one column) If you need to delete based on a range of values, either you use BETWEEN or you use inequalities: delete from your_table where id between bottom_value and top_value; or delete from your_table where id >= a_value and id <= another_value;

Ajax Live Data Search using Jquery PHP MySql

Image
Here is the solution for Dynamic table search Based on Ajax, Jquery, PHP MySql Source Code index.php <html> <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title>Dynamic Search Based on name</title>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> </head> <body> <div class="container">     <br />     <h2 align="center">Search Based on Medicine Name</h2><br />     <div class="form-group">         <div class="input-group">             <span class="input-group-addon"...

How to Add the Hibernate Option to the Windows 8.1 Power Button

Image
Microsoft has made Windows 8.1 easier to shut down, but there still a glaring omission — the absence of the Hibernate option. Here’s how you get it back.              Shutting down Windows 8.1 is easier than shutting down Windows 8 is. That’s because the first time you want to power down your system you’ll see a glaring omission. There’s no Hibernate option. There only are options to Shutdown, Restart, or put your system in Sleep mode. Here’s how to add the Hibernate option to the Windows 8.1 power button. You just need to configure some power settings first. How to add the Hibernate option to the Windows 8.1 power button … To add the Hibernate option, hit the keyboard shortcut Windows Key + W to open the Search Settings. Windows Key + W to search in settings Windows Key + S   to search Everywhere Type:  power options and then select the P ower Options or directly open the control panel and follow the screen shots... Step 1: open control pan...