PHP - Delete After X Hours
I am trying to make a function that is customizable to delete a query from a database.
Here's the function. function checkHashs($hours) { if($getHashs = mysql_query('SELECT * FROM `hash_codes`')) { $dateQ = mysql_query('SELECT MAX(addedon) AS lastVoteDate FROM `hash_codes`') or die(mysql_error()); $getDate = mysql_fetch_assoc($dateQ); $diffrence = time() - strtotime($getDate['lastVoteDate']); echo $diffrence / 60 / 60; if (($diffrence / 60 / 60) >= $hours) { mysql_query('DELETE FROM `hash_codes` WHERE `addedon` = '. ($diffrence / 60 / 60) >= $hours .'') or die(mysql_error()); } } } And I am trying to call it by checkHashs(24); What I am trying to do is make it so when that function is ran it will delete all oh the guerys that have the `addedon` row over X hours(24 hours in this case). Any ideas? Similar TutorialsHi, I have a row In mysql data base called time and the content is filled with the time function time (); I want to know is there a way to achieve this I want the entire column deleted if it has been 24 hours since the time row was filled. I want this to happen automatically I don't really know how to achieve this so any help would be much appreciated thanks. basically could somebody help me with information on having a php script that deletes mysql rows which are older than 3 hours old. I know MYSQL table will need a date/time column but how can I only target ones which are 3 hours old+. Thanks Hi all. Here is my scripts which allow user to check multiple rows of data and delete it , but it require select data and click for twice to delete the rows , what should be the error? Code: [Select] <form name="frmSearch" method="post" action="insert-add.php"> <table width="600" border="1"> <tr> <th width="50"> <div align="center">#</div></th> <th width="91"> <div align="center">ID </div></th> <th width="198"> <div align="center">First Name </div></th> <th width="198"> <div align="center">Last Name </div></th> <th width="250"> <div align="center">Mobile Company </div></th> <th width="100"> <div align="center">Cell </div></th> <th width="100"> <div align="center">Workphone </div></th> <th width="100"> <div align="center">Group </div></th> </tr> </form> <? echo "<form name='form1' method='post' action=''>"; while($objResult = mysql_fetch_array($objQuery)) { echo "<tr>"; echo "<td align='center'><input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"$objResult[addedrec_ID]\"></td>"; echo "<td>$objResult[addedrec_ID] </td>"; echo "<td>$objResult[FirstName]</td>"; echo "<td>$objResult[LastName] </td>"; echo "<td>$objResult[MobileCompany] </td>"; echo "<td>$objResult[Cell] </td>"; echo "<td>$objResult[WorkPhone] </td>"; echo "<td>$objResult[Custgroup] </td>"; echo "</tr>"; } echo "<td colspan='7' align='center'><input name=\"delete\" type=\"submit\" id=\"delete\" value=\"Delete\">"; if (isset($_POST['delete']) && isset($_POST['checkbox'])) // from button name="delete" { $checkbox = ($_POST['checkbox']); //from name="checkbox[]" $countCheck = count($_POST['checkbox']); for($d=0;$d<$countCheck;$d++) { $del_id = $checkbox[$d]; $sql = "DELETE from UserAddedRecord where addedrec_ID = $del_id"; $result2=mysql_query($sql) or trigger_error(mysql_error());;; } if($result2) { $fgmembersite->GetSelfScript(); } else { echo "Error: ".mysql_error(); } } echo "</form>"; Thanks for every reply. <body> <?php include 'sql.php'; $query = "SELECT * FROM validation"; $result = mysqli_query($con , $query); $rows = mysqli_fetch_assoc($result) ; $totals = mysqli_num_rows($result) ; ?> <div id="css"> <form > <table width="80%" border="0" cellpadding="2" cellspacing="2" > <caption><h2>Personal Details of Customers</h2></caption> <tr class="white"> <td bgcolor="#330033"> </td> <td bgcolor="#330033"> Id Number </td> <td bgcolor="#330033"> Full Name </td> <td bgcolor="#330033"> Email Address </td> <td bgcolor="#330033"> Website </td> <td bgcolor="#330033"> Comment </td> <td bgcolor="#330033"> Time </td> </tr> <?php while($rows=mysqli_fetch_assoc($result) { <tr> <input type="raido" name="ID" value="<?php echo $rows['ID']; ?>" /> <td bgcolor="#FFFFCC"><?php echo $rows['ID'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Name'];?> </td> <td bgcolor="#FFFFCC"><?php echo $rows['Email'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Website'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Comment'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Time'];?></td> <td> </td> <td> <a href="delete.php? ID= "$rows[ID]" /"> <input type="submit" name="del" value="Delete" /> </a> <input type="button" name= "edit" value="Edit" /> </td> </tr> }?> </table> </form> </div> </body> Hi,
I wish to find out is there any possible that I can delete some data inside my php website but inside my sql database, the record will still at there?
Thank you.
I'm trying to set it so that it will delete an entire populated directory based upon a value in the database then after finishing that to go back and delete that row in the database. my current code is Code: [Select] <?php $page_title = "Central Valley LLC | Photo Addition" ?> <?php include("header.php"); ?> <?php include("nav.html"); ?> <div id="content"> <form action="delprod.php" method="post" enctype="multipart/form-data"> <label for="which">Choose A Product To Remove:</label> <?php $con = mysql_connect("localhost","phoenixi_cv","centraladmin"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("phoenixi_cvproducts", $con); $result = mysql_query("SELECT * FROM Products"); echo "<select name=\"which\">"; while($row = mysql_fetch_array($result)) { echo "<option "; echo "value=\"" . $row['id'] . "\">"; echo $row['Name'] . "</option>"; } echo "</select>"; mysql_close($con); ?> <br /> <input type="submit" name="submit" value="Submit" /> </form> </div><!--#content--> <?php include("footer.html") ?> and the delete script Code: [Select] <?php $con = mysql_connect("localhost","phoenixi_cv","centraladmin"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("phoenixi_cvproducts", $con); $result = mysql_query("SELECT id FROM Products WHERE id=$_POST['which']"); $row = mysql_fetch_array($result) chdir('assets'); chdir('images'); $mydir = $row . '/'; $d = dir($mydir); while($entry = $d->read()) { if($entry!="." && $entry!="..") { unlink($_POST['which'] . '/' . $entry); } } rmdir($mydir); $result = mysql_query("DELETE * FROM Producs WHERE id=$_POST['which']"); ?> Thank you in advance for all your help. any easier ways of approaching this will be welcome as well in my MySql database i have a field "created_at" = now() for ex: 2011-05-23 11:47:28 i need to add two hours to that so i have 2011-05-23 13:47:28 how will i do this please? i have this so far but it is not correct: $currentTime = time($msg->getCreatedAt()); $timeAfterOneHour = $currentTime+60*60; $date=date("Y-m-d H:i:s",$timeAfterOneHour); please help thank you Im using $time = date('Y-m-d H:i:s'); How can I make a new variable that adds 4 hours on the $time output. Hello I am trying to do a cronjob to check if a user has been online within the past 24 hours. I have a column with "last_login" with this format: "1337593284". How can I do a simple if (last_login+24hours< servertime) { do something... It was suppose to be my day off but here I set in front of the computer trying to figure out some code. I can not get my code to send me the information that is inputted into the fields. The style is what I want but most importantly it has got to work. I'm going to put the PHP code and the HTML code. If you need the CSS code I can post that. I'm not sure if you guys need that though. Hopefully someone out there can help me out. I know it might be a very simple error causing me tons of problems. I just can't figure it out. I'm novice at this stuff. PHP CODE & HTML CODE: <?php if ($_POST["email"]<>'') { $ToEmail = 'Justin@fullloop.net'; $emailSubject = 'contact'; $mailheader = "From: ".$_POST["email"]."\r\n"; $mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; $MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; $MESSAGE_BODY = "Phone: ".$_POST["phone"]."<br>"; $MESSAGE_BODY .= "Your Email: ".$_POST["email"]."<br>"; $MESSAGE_BODY .= "Your Message: ".nl2br($_POST["comment"])."<br>"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> <html> <body> <?php echo $_POST["name"]; ?>,<br /> Thank you for contacting Full Loop Inspections. We take great pride in our services and we are grateful you are considering us to complete your inspection. An inspector will contact you at <?php echo $_POST["phone"]; ?> or email you at <?php echo $_POST["email"]; ?> . </body> </html> <?php } else { ?> <form id="contacts-form" method="post" action="contact.php"> <fieldset> <div class="field"> <label>Your Name:</label> <input type="text" value="" name="name"/> </div> <div class="field"> <label>Your Phone:</label> <input type="text" value="" name="phone"/> </div> <div class="field"> <label>Your E-mail:</label> <input type="text" value="" name="text"/> </div> <div class="field"> <label>Your Message:</label> <textarea cols="1" rows="1"></textarea> </div> <div class="wrapper"><a href="contact-us.html" onClick="document.getElementById('contacts-form').submit()" class="link1"><em><b>SUBMIT</b></em></a></div> </fieldset> </form> <?php }; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head profile="http://www.w3.org/2005/10/profile"> <link rel="icon" type="image/gif" href="images/favicon.gif" /> <head> <title>Full Loop Inspections | Columbus Ohio #1 Home Inspector | Home Inspectors | Commercial | Mold | Grove City </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="Certified inspectors performing commercial and home inspections in Columbus, Grove City, Hilliard, Gahanna and surrounding areas" /> <meta name="keywords" content="Columbus home inspectors, Grove City Inspectors, Home Inspections, Home Inspector" /> <meta name="author" content="Full Loop Inspections | Home | Commercial | Mold | Radon | Mold Inspectors - http://www.fullloop.net" /> <link href="style.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="js/cufon-yui.js" type="text/javascript"></script> <script src="js/cufon-replace.js" type="text/javascript"></script> <script src="js/Myriad_Pro_400.font.js" type="text/javascript"></script> <script src="js/Myriad_Pro_600.font.js" type="text/javascript"></script> <script src="js/NewsGoth_BT_400.font.js" type="text/javascript"></script> <script src="js/NewsGoth_BT_700.font.js" type="text/javascript"></script> <script src="js/NewsGoth_Dm_BT_400.font.js" type="text/javascript"></script> <script src="js/script.js" type="text/javascript"></script> <!--[if lt IE 7]> <script type="text/javascript" src="js/ie_png.js"></script> <script type="text/javascript"> ie_png.fix('.png, #header .row-2 ul li a, .extra img, #search-form a, #search-form a em, #login-form .field1 a, #login-form .field1 a em, #login-form .field1 a b'); </script> <link href="ie6.css" rel="stylesheet" type="text/css" /> <![endif]--> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-24965394-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script> </head> <body id="page5"> <div id="main"> <!-- HEADER --> <div id="header"> <div class="row-1"> <div class="fleft"><a href="home.html"><img src="images/logo.png" alt="full-loop-inspections" /></a></div> <div class="fright"> <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=146395285448812&xfbml=1"></script><fb:like href="http://www.facebook.com/pages/Full-Loop-Inspections/237677882939676" send="true" layout="button_count" width="150" show_faces="true" action="like" font=""></fb:like> <g:plusone size="small"></g:plusone> <ul> <li><a href="home.html"><img src="images/icon1.gif" alt="home-inspections" /></a></li> <li><a href="contact-us.html"><img src="images/icon2-act.gif" alt="contact-a-home-inspector" /></a></li> <li><a href="home-inspectors-service-area.html"><img src="images/icon3.gif" alt="home-inspectors-sitemap" /></a></li> </ul> </div> </div> <div class="row-2"> <div class="left"> <ul> <li><a href="home.html"><span>home</span></a></li> <li><a href="inspection-services.html"><span>inspection services</span></a></li> <li><a href="payments.html"><span>Make Payments</span></a></li> <li><a href="contact-us.html" class="active"><span>contact</span></a></li> <li class="last"><a href="home-inspectors-service-area.html"><span>Service Area</span></a></li> </ul> </div> </div> <div class="row-3"> <div class="inside"> <h2>Columbus Ohio<b>Inspections</b></h2> <p>Full Loop Inspections services Columbus Ohio and surrounding cities. Franklin, Madison, Union, Delaware, Licking, Pickaway and Fairfield counties. Contact us today to set an Inspection appointment. </p> </div> </div> <div class="extra"><img src="images/header-img.png" alt="Columbus-Ohio-Inspectors" /></div> </div> <!-- CONTENT --> <div id="content"><div class="inner_copy">More <a href="http://www.templatemonster.com/">Website Templates</a> at TemplateMonster.com!</div> <div class="box"> <div class="border-bot"> <div class="right-bot-corner"> <div class="left-bot-corner"> <div class="inner"> <div class="box1 alt"> <div class="inner"> <h4><b>Our</b> Contacts</h4> <div class="address"> <p><b>Inspector:</b> Justin Ashley<br /> <b>Telephone:</b>614-256-6505<br /> <b>Address:</b>4690 Helmsbridge Ct<br /> <b>City:</b>Grove City, OH 43123<br /> <b>e-mail:</b><a href="mailto:Justin@Fullloop.net?subject=Online Inspection Referral">Justin@Fullloop.net</a></p> </div> <p class="p0 extra-wrap"><br /> <span class="img-box1"><img src="images/InterNACHI.png" alt="InterNachi-Home-Inspectors" width="81" height="70" /></span><span class="img-box1"><img src="images/Infrared_Certified_Small.png" alt="Thermal-Imaging-home-inspector" width="57" height="70" /></span><span class="img-box1"><img src="images/IAC_Mold_Radon.png" alt="mold-inspector" width="94" height="70" /><img src="images/Columbus-board-of-realtors.jpg" alt="mold-inspector" width="70" height="70" /></span></p> </div> </div> </div> </div> </div> </div> </div> <div class="indent"> <div class="wrapper"> <div class="col-1"> <h3><b>Contact</b> Form</h3> <form id="contacts-form" method="post" action="contact.php"> <fieldset> <div class="field"> <label>Your Name:</label> <input type="text" value="" name="name"/> </div> <div class="field"> <label>Your Phone:</label> <input type="text" value="" name="phone"/> </div> <div class="field"> <label>Your E-mail:</label> <input type="text" value="" name="text"/> </div> <div class="field"> <label>Your Message:</label> <textarea cols="1" rows="1"></textarea> </div> <div class="wrapper"><a href="contact-us.html" onClick="document.getElementById('contacts-form').submit()" class="link1"><em><b>SUBMIT</b></em></a></div> </fieldset> </form> </div> <div class="col-2"> <div class="box2"> <div class="border-top"> <div class="left-top-corner"> <div class="right-top-corner"> <div class="inner"> <h4><b>Property </b>Info</h4> <ul class="news"> <li><a href="full-loop-inspections">Sept 13, 2011</a> <p>When contacting us please provide as much information as you can about the property.</p></li> <li><a href="full-loop-inspections">Sept 13, 2011</a> <p>We will take the time to answer any questions you might have. </p></li> </ul> </div> </div> </div> </div> </div> <div class="box3"> <div class="right-bot-corner"> <div class="left-bot-corner"> <div class="inner"> <center> <p> </p> <p> </p> <p><img src="images/JPicture.jpg" alt="Home-Inspectors-Columbus" /></p> <p> <strong><font color="#FFFFFF">Full Loop Inspections<br /> Certified Home Inspector<br /> Justin Ashley<br /> 4690 Helmsbridge Ct<br /> Grove City, OH 43123<br /> (614)-256-6505</strong><br /><a href="mailto:Justin@Fullloop.net?subject=Inspection"><font color="#000000"> Justin@Fullloop.net</font></a></p> </center> </div> </div> </div> </div> </div> </div> </div> </div> <!-- FOOTER --> <div id="footer"> <div class="footer-nav"> <div class="left"> <ul> <li><a href="home.html">Home</a></li> <li><a href="inspection-services.html">Services</a></li> <li><a href="payments.html">Payments</a></li> <li><a href="contact-us.html">Contact</a></li> <li class="last"><a href="home-inspector-links.html">Links</a></li> </ul> </div> </div> <div class="bottom"><p><a href="http://www.fullloop.net" class="new_window">Full Loop Inspections</a> </p> <p>Servicing <strong>COLUMBUS</strong> - Bexley - Canal Winchester - Dublin - Gahanna - Grandview Heights - Grove City - Hilliard - New Albany - Pickerington - Reynoldsburg - Upper Arlington - Westerville - Whitehall - Worthington and all surrounding cities </p> </div> </div> </div> <script type="text/javascript"> Cufon.now(); </script> </body> </html> I would like to create function, what prints times to specified day. For example Day time total 1 10 - 12 2 2 0 (or nothing) 3 10 - 12:15 2:15 4 10:30 - 12 1:30 5 10 - 12 2 6 0 (or nothing) 7 0 (or nothing) Time comes from database and there is column for day, starting time (like 10), ending time (like 12:15) and total, calculated, time in db. So day and times come from db. Have thinked this much, but can't figure out how. Hi, I have a database where I store times with the Now(); function. What I want is: When the viewer looks at the post, instead of it saying: Posted: 2010-11-14 19:08:14, I want it to say posted: x hours ago, Posted: x days ago, etc. Any help with this would be appreciated! I have a weird issue. I'm working on something where people will submit hours for a business. Originally it was free form text, but then I figured it may get messy with people doing M-F 9-5 then Monday through Friday, 9AM to 5PM, Mon-Fri, etc. So I switched to a bunch of inputs. It has each day then a select for from and one for to. Data is passed to the script as a form submission. Vars are named HF# and HT# (hours from, hours to and a 0-6 digit for Mon-Sun). I want to take the input and output a string as such:
Mon-Tue, 8:00 AM to 5:00 PM
Thu-Fri, 8:00 AM to 5:00 PM
Sat, 9:00 AM to 1:00 PM
Sun, 12:00 PM to 3:00 PM
I did this:
$formdata = array(); $formdata["hf0"] = "8:00 AM"; $formdata["ht0"] = "4:30 PM"; $formdata["hf1"] = "8:00 AM"; $formdata["ht1"] = "4:30 PM"; $formdata["hf2"] = ""; $formdata["ht2"] = ""; $formdata["hf3"] = "8:00 AM"; $formdata["ht3"] = "4:30 PM"; $formdata["hf4"] = "8:00 AM"; $formdata["ht4"] = "4:30 PM"; $formdata["hf5"] = "9:00 AM"; $formdata["ht5"] = "1:00 PM"; $formdata["hf6"] = "12:00 PM"; $formdata["ht6"] = "3:00 PM"; $WeekDays = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); $hours = ""; $sd = "Mon"; $ld = ""; $fr = $formdata["hf0"]; $to = $formdata["ht0"]; for ($x=0; $x<=6; $x++) { if (empty($sd) && !empty($formdata["hf$x"])) { $sd = $WeekDays[$x]; $fr = $formdata["hf$x"]; $to = $formdata["ht$x"]; } if ($fr != $formdata["hf$x"] || $to != $formdata["ht$x"]) { $hours .= "$sd" . (($sd==$ld)?", ":" - $ld, ") . " $fr to $to<br/>"; if (!empty($formdata["hf$x"])) { $sd = $WeekDays[$x]; $fr = $formdata["hf$x"]; $to = $formdata["ht$x"]; } else { $sd = ""; } } $ld = $WeekDays[$x]; }($formdata was because I was tired of hitting back, changing the data then resubmitting) This kinda works, but it skips Sunday. There has got to be a better way to do this.. any ideas? Okay I want to run some code every 24 hours, what would be the best way to do this? Also I don't have root to the server or anything. Hey Guys. I am writing a function that will output to the user if a store is open or not.
I wrote a fucntions named is_store_open() with a variable called $day which will have the current day of the week assigned to it.
Lets say it is Saturday. it finds the case for "Saturday" and checks the opening time and closing time for Saturday.
The problem that I am facing, is when the store is open past midnight on Saturday. It then won't check the case for saturday.
Instead will check the case for Sunday. Which is not what I want, becuase it will show the store as closed when its open still open on "Saturday"
I wrote a function below that checks to see if the previous day closing hours are greater then the current time. If its true then return true and I guess that should fix the problem.
But when I wrote that it would give me an error saying that $saturday_close is undefined. I'm guessing its becuase its in a switch satement, and it does not equal to that day.
I'm a little bit confused on how to set this up. If anyone has a suggestion I would really apprecaite your help. Thanks!
function is_store_open(){ $set_time = strtotime("tomorrow"); // Lets just sat its Sunday for testing purposes $day = date("l", $set_time); $time_now = mktime("00", "00", "00"); // Now lets say the time now is 12:00am switch ($day) { case "Saturday": $open = "11:00"; $saturday_close = "1:00"; break; case "Sunday"; if($saturday_close > $time_now ){//If the $monday_close hours are greater then the current time return false the store is still open return true; } else { $open = "2:00"; $close = "22:00"; } break; } }// End of function if(is_store_open()) { echo "Oh no! There is still a glitch in the system the store needs to remain open"; } else { echo "The store is still open on Saturday"; } hii I have made some code that works out the difference between two timecodes. IE Time 1 Time 2 Time2-Time1 1330613232 - 1330613545 = 313 Im wanting to express the difference in terms of hours. 313 as a time code is 00:06:49 but I want it to show 0.12 hours. how would I achieve this? x Hello, I have a very simple table... DAY (Y-m-d) / TIME (00:00:00) / POWER (INT) I am using a Jquery datepicker to select the date on the page, and that POST to the PHP file. I am trying to select values from Mysql to make 3 HighCharts Graphs using the selected day of the datepicker. I have started with the DAY graph PHP to get the values for each hour of a 24 hour day. I need to get the values for each hour... 23,12,15,35 etc... , and then I need for the 31 days of a month for the month graph, and 12 months of the year for the month graph all in the same way so the HighCharts can use the values to make the chart (3 php files, one for each graph) Here is the PHP I have for the 1 day that should get the 24 individual hour data, but it does not seem to work... <?php $choice = (isset($_POST['choice'])) ? date("Y-m-d",strtotime($_POST['choice'])) : date("Y-m-d"); $con = mysql_connect("localhost","root","mackie1604"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("inverters", $con); $sql = "SELECT HOUR(time), COUNT(power) FROM feed WHERE time = '".$choice."' GROUP BY HOUR(time) ORDER BY HOUR(time) "; $res = mysql_query($sql) or die('sql='.$sql."\n".mysql_error()); $row = mysql_fetch_assoc($res); echo $row['choice'].'<br />'; ?> What have a written wrong in the sql query ??? Alan $date = date('G:i', $row_teams['startTime']); // this date looks like this 15:30 I am trying to add 2 hours to it, any suggestions please I have the below code wish I wish to add 12 hours to: Code: [Select] $today = date('D', mktime(0,0,0,date('m'),date('d')+0,date('Y'))); anyone to show how I add 12 hours? |