Query PHP: how to determine if the variable time is before or after today

Hello

I have this code which determines the issue of whether or not the date of return of a book (format: d/m/Y) either before or after today.

<? PHP if ($row ['return_date'] > = date("d/m/Y")) {? >}

< a href = "loaning_remind.php? loan_id = <?" PHP echo $row ['id'];? ">" onClick = "return confirm (" the loan will receive an e-mail to remind their ready point is due to return ' ")" >

< div class = "record_button" >

"" < img src = "... / images/icons/mail_icon_blue.png" width = "100%" height = "auto" title = "Send Email Reminder" >

< / div >

Future

< /a >

<? PHP} else {? >}

< a href = "loaning_remind_late.php? loan_id = <?" PHP echo $row ['id'];? ">" onClick = "confirm return (" the loan product will receive an e-mail reminding that ready article's late return ' ")" >

< div class = "record_button" >

"" < img src = "... / images/icons/mail_icon_blue.png" width = "100%" height = "auto" title = "Send Email Reminder" >

< / div >

Towards the end

< /a >

<? PHP}? >

At the moment it does not work, as the script checks the date and adds 2 months.

For example:

Today's date is: 10/15/2015

If the date of return to the book is: 15/12/2015 (2 months from today ' hui), the script will display the icon NOT LATE .

If the date of return to the book is 12/14/2015 (less than 2 months from today ' hui), the script will display the LATE icon.

I don't have any other script to do it with the time or date, so I ruled out the possibility that it gets messed up by other code.

The database variable takes the form: d/m/Y

Then, it is not stored as a date data type. MySQL stores dates in the form A-m-j. I think it's really important to use the date data type, so I recommend you, if it's humanly possible, change your dates in the correct format. Otherwise, as the application evolves, you'll regularly find yourself having to deal with the fact that your arrival dates are not really dates.

Tags: Dreamweaver

Similar Questions

  • How to determine if the variable exists?

    I need to find a way to determine if a variable exists.  Because if I don't and evaluate a variable that does not exist, I get error.  This is why I need to do this.  I need to print only the failures in the sequence and the problem is that I can print only the failures that causes failure of the sequence.

    I have reduced that there is a Boolean status in the list of TS results. StepCausedSequenceFailure.  The question is this variable exists only when the step caused sequence failure checkbox is checked, otherwise this variable is not in the results.  Thanks for help.

    Use PropertyExists ("Locals.ResultList [x]. TS. "" "StepCausedSequenceFailure"), where "x" is the index of the step that interests you as a precondition to any approach that will access this value. "

    I hope this helps.

    -Jack

  • How to determine whether the current operating system is windows, or MAC?

    How to determine whether the current operating system is windows, or MAC?

    CSparrow wrote:

    operatingSystem var = $.getenv ("OS");

    operatingSystem = operatingSystem.toString ();

    alert (operatingSystem);

    It gives me Windows NT Windows 10

    With the help of:

    alert($.os);
    

    works for me.

    (result: Windows/64 10.0)

    and the Silly-V code

    Folder.FS

    gives you the name of the operating system

  • How can I get the exact time and date on my FAX LOG

    I have a new HP Officejet 6500 has more on my Dell Inspiron Windows XP computer.  How can I get the exact time and date on my FAX log?

    Hi FrederickFrank7,

    Journal of faxes would just follow the time of your printer. Please set the time and date of your printer.

    I am an employee of HP.
    Please indicate the position that solved your problem as "acceptable Solution".

  • How can I recover the files and programs before a system restore? my document folders are all empty and my programs will not open!

    How can I recover the files and programs before a system restore?  my document folders are all empty and my programs will not open!

    I know they are there and hidden somewhere, but this restoration took my settings of the computer to 2004! We lost all our data, our software that we use to operate our company at home, our quickbooks that has all our financial data, family photos, videos, Outlook will work not so no e-mail, all turned in time and 6 years ' worth of documents have disappeared.

    What happeneded was that I was trying to upgrade to quickbooks software when I got an error, I cancelled out of the facility, then restarted and that's when I got an error hal.dll something? I thought about a system restore would allow me to go back in time to just before when the error occurred, but he basically took my computer back to factory settings, so all the programs that I installed and paid hundreds of dollars for the past six years has disappeared, Microsoft Office and very expensive construction estimating software that we wil have to pay once AGAIN for If I can't get this program working properly.

    I am a fool! I can't believe what's happening.

    Someone at - it instructions on how I can retrieve either the programs and data that I need specifically or how to go and seek shade from the files I read online on and restore my computer for about 12 hours ago?

    Thank you all!

    Sally in Georgia

    Looks like you did a system rather than a system restore recovery.  If you have inserted a disc supplied with your machine and booted from it, you probably erased the disc and installed the original operating system provided with your computer.  Usually, a step in this recovery is to do a full format or quick of your drive.  If you did a full format, your data is permanently lost.  With a quick format, your data may still be there, somewhere but inaccessible by normal means.  Applications must generally be installed, in order to recover the files probably will not help unless you have the original installation media.  Your other data files (images, videos, financial data) may be salvageable, but at this point, it would be advisable to take your computer or your disk to a business/professional who is experienced with data disc recovery.  It will be cheap and there is no guarantee.

    Impatient, remember investigate you a backup strategy for your computer and critical data.  Hard drives can go wrong with little or no warning.

    HTH,
    JW

  • How do you find the last time that an address older Windows Live Hotmail has been used if you don't remember the password?

    How do you find the last time an old hotmail address was used... especially if you can't remember the exact password?

    original title: old hotmail address

    How do you find the last time an old hotmail address was used... especially if you can't remember the exact password?

    Good enough if you can't on the account and you can't prove it is yours in order to regain access (via password self-service reset, etc)-then you won't know anything about the account.

  • How do you define the current-time indicator to return to the point that he started on an audio overview?

    in the most recent version of the software, how do you define the current-time indicator to return to the point that he started on an audio overview? He did it in the old version. I don't find a setting for this in 2015 software. Thank you

    You can use the zero on the numeric keypad key. See the sixth in this article:

    known issues in after effects CC 2015 (13.5). After the effects of interest area

  • If I buy acrobat from a party private how can I check the status of liscense before buying?

    If I buy acrobat from a party private how can I check the status of liscense before buying?

    1. you can not.

    2. There is a lot of product counterfeit around, even though the seller did not know.

    3. If you do not purchase be sure to get a form to "transfer license" filled in the seller otherwise they maintain (and have not sold) the rights to run the software.

  • How can I calculate the total time in java?

    Hello!

    I need to calculate the total time!

    For example I start time:
    Format formatter1;
    Date date1 = new Date();
    formatter1 = new SimpleDateFormat("hh:mm:ss");
    Dim startTime = formatter1.format (date1);
    startTime = "14:20:40.

    And I have finishing time:
    Format formatter2;
    Date2 date = new Date();
    formatter2 = new SimpleDateFormat("hh:mm:ss");
    String finishTime = formatter2.format (date2);
    finishTime = '08:30:55;



    Also, having calculated manually, I get the total time: '18:10:15.

    How can I calculate the total time in java? (Using formatter1 and formatter2 I guess)

    What I need is to print 'total 18:10:15 '.

    Thank you!

    800512 wrote:
    I did the following, but I think something's wrong here:

    I've defined before: Date date1 = new Date(); Date2 date = new Date();
    And it should be exactly 5 seconds between them.

    I found the delta between date1 and date2:

    Format formatter = new SimpleDateFormat("HH:mm:ss");
    timeInMilliFromStart long = date1.getTime () - date2.getTime ();
    Date date3 = new Date (timeInMilliFromStart);
    String timeInSecFromStart = formatter.format (date3);

    and I still get
    timeInSecFromStart = 02:00:05

    But it should be exactly 00:00:05.

    What is a problem?

    Because, as I said, a Date to measure a moment in time, not a period. So when you have 5000 ms, and you that transform a Date, this means that 5 seconds after the time, which equals 00:00:05.000 01/01/1970 GMT.

    As I said, if you are not currently in GMT, then you must set the DateFormat GMT TZ. Right now, it's to show you the time in your TZ. If you have included the date in your SimpleDateFormat, you would see the 01/01/1970 or 31/12/1969, function that TZ you find.

    Bottom line: you try to use these classes in a sense they are not intended for, and while you can get the results you want for a limited set of entries if you understand how these classes and how to work with it, it is a fragile approach and comes with all sorts of warnings warning.

  • How do you change the display time of slide

    I have a slide that has a 30 sec display time.  I want to change it to 6 seconds.  Then I'll drag propteries and change the display of the time in 6.  I click OK but it make no difference.  When I look at the properties again, the time is set back to 30 seconds!

    How can I change the display time of slide?

    Check your timeline - sounds like you have something there (maybe do scroll to the right to see) which forces the duration to 30 seconds.

  • How do I know the elapsed time


    Hello

    The difference between your option (a) and (b) is as below:

    (a) you get timestamp of the time before and after processes and subtract to find the elapsed time between the two... I will suggest you to convert time double data type before subtracting stamps...

    (b) you get "millisecond" of timer tick before and after the process count and subtract to find the elapsed time between the two... and last multiplication is 1000 to convert it to second...

    In my opinion, I'd rather (a)

    Thank you

    HS

  • all of a sudden all of the emails I received before 14:00 today are all the source code for the new ones nsince PAREN then are all readable ideas?

    all of a sudden all of the emails I received before 14:00 today are all code source hyperlink the nine since then are all readable ideas?

    Right-click on the folder, select Properties, and then choose the button repair.

    Long term solution is to not allow your anti virus scan profile of Thunderbird folders.

  • How I wear on the variables in the database of a page to another?

    I have a MySQL database displayed in a table on one page, with a link in each row, pointing to a DETAILS.php page where I want to show the end user all the details of this record or a line item in a different format. After that I have a link to the new page, how should I address variables for "this particular record" clicked on in the 1st page? What is the system automatically knew which record of the row in the table that I linked to?

    lesliebrownadobe wrote:

    I have a MySQL database displayed in a table on one page, with a link in each row, pointing to a DETAILS.php page where I want to show the end user all the details of this record or a line item in a different format. After that I have a link to the new page, how should I address variables for "this particular record" clicked on in the 1st page? What is the system automatically knew which record of the row in the table that I linked to?

    Each record in your database must have a "unique" identifier (primary key), tying the record to it.

    You then pass this "unique identifier" to the details page in the link that you create using php for loop through each record found in the database, which no doubt you already have.

    On the details page then use you php to get the id of the file sent to the page via the link:

    $id = $_GET ['id'];

    Once you have the id that you are in business and can create a mysql on the database query to get the record corresponding to the code

    SELECT * FROM table WHERE id = "$id".

    'id' is the 'unique' field in the database that identifies records and the "$id" being the variable passed from the link

  • How to determine that the user has purchased an article or not?

    Hello

    Can someone tell me how can I determine if the user has purchased an article or not?

    Until now, I add to the cart and then allow user to pay for this item through Paypal. But now, my goal is to show all these items that the user has already added, but not bought yet.so, whenever user logs in a/c, he can see the item in my cart.

    Please... help me

    This sounds like a question of PayPal, then you will want to check these forums. If you were using in-app purchases of BB, so yes, it has an API to check the previous in-app purchases.

  • How to determine if the rank of the acquired list focus?

    Hi all

    I have ListField with custom reminder.

    When the user change focus by the movement of the navigation, drawListRow() is called several times - for each focus-changed event.

    How can I determine in the method drawListRow() if current rank on the FOCUS_GAINED event?

    I can do that by following the path:

    public void focusChanged( Field field, int eventType )    {        mIsFocusGained = false;
    
            if( eventType == FOCUS_GAINED )        {            mIsFocusGained = true;        }    }
    
     public void drawListRow( ListField listField, Graphics graphics, int index, int y, int width )    {        int rowHeight = listField.getRowHeight();        int selectedIndex = getSelectedIndex();
    
            if( index == selectedIndex && mIsFocusGained )        {            drawHighlightRegion( graphics, HIGHLIGHT_FOCUS, true, 0, y, width, rowHeight );        }---------
    

    But I can do that directly in drawListRow()?

    Thank you

    I expected allows you to change your listener to update as follows:

    if ( eventType == FOCUS_GAINED )
    {
    mIsFocusGained = true;
    }
    else
    if ( eventType == FOCUS_LOST )
    {
    mIsFocusGained = false;
    }
    

    I think you should ignore FOCUS_CHANGED because the listField stil keep focus in these events.

    I'm not clear on what you mean by that:

    "is that a function is to determine/get current theme ceremony?

    I thought you did that with your FocusChange listener?

Maybe you are looking for

  • When I have several tabs open, I only see the tab that I am in, all the other tabs are not visible at all.

    I only know that there is more than one tab open because when I click in the empty space on the tab bar appears the other tab. then the one that I've been on disappears, until I click in the space were is was before. ?? .... Help, please! Thank you v

  • Stream 11 HP: HP flow 11 not answer anything

    I went and stopped a program to run at first upward and do not know which.  Now my computer does not respond. It opens not internet, open Task Manager, no indication for the Device Manager, nothing shows to restore or retrieve. I thought to go to the

  • Pavilion 15-f337: Hp Pavilion 15-f337wm Bluetooth

    This computer is great. Everything works perfectly and makes it easy to adapt to windows 10. The only problem I have is that I have no Bluetooth radio to the computer, but it has a Bluetooth function on the software. I need to know if there is a Blue

  • cvixml. Available in cvi 5.5 FP

    I am allowed to use the CVI 5.5 because of the large number of already written programs.  I now have an obligation to generate xml documents.  The cvixml.fp is available for download and can be used in the CVI 5.5? concerning KelUk

  • Problems with Windows 7: Internet Explorer and black screen

    I recently took my old Acer Aspire laptop 8375 from the dead. If I remember correctly, it is from 2008 and has Windows 7 installed on it. When I try to start my PC, everything's fine until it connects to the account. Suddenly, a black screen will app