Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    26

    Unanswered: comparing 2 timestamp

    Hi,

    i would like to compare two value of timestamp

    so my code is
    Code:
    $todayDate= date("Y-m-d 00:00:00");
    $todayEnd= date("Y-m-d 23:59:59");
    
    $query_reg_list= "select p.patientId, m.MRId, p.pname, p.alergi";
    $query_reg_list.=" from MR m, patient p, havePatient h where h.MRId=m.MRId and h.patientId=p.patientId and regDate>='$todayStart' and regDate<='$todayEnd' order by p.patientId";
    does anyone know how to compare these values? cause i always get empty result for that..
    thank's for our attention

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please echo the sql after the variable substitution, i.e. instead of executing it

    we need to see the same sql that mysql sees, e.g. if you were to run your query outside of php
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2007
    Posts
    26
    Hi.. thank's for the reply...
    i have already solved it..
    thanks..
    regards,

  4. #4
    Join Date
    Mar 2004
    Posts
    480
    don't post asking for help if you don't post the solution afterwards, even if you figure it out yourself. Just common courtesy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •