Jump to content

[SOLVED] Date and Time Question


wsantos

Recommended Posts

got nothing so for except for input boxes that return string...

 

    <FORM NAME=DATE ACTION="http://myip/myfile.php" METHOD=POST>
      <TABLE ALIGN=CENTER>
        <TR>
          <TD>START</TD>
          <TD><INPUT NAME='StartMonth'></TD>
          <TD><INPUT NAME='StartDate'></TD>
          <TD><INPUT NAME='StartYear'></TD>
        </TR>
        <TR>
          <TD>END</TD>
          <TD><INPUT NAME='EndMonth' WIDTH=2></TD>
          <TD><INPUT NAME='EndDate'></TD>
          <TD><INPUT NAME='EndYear'></TD>
        </TR>
        <TR>
          <TD COLSPAN=4><INPUT TYPE=SUBMIT VALUE=SUBMIT></TD>
        </TR>
      </TABLE>
    </FORM>

 

it would be better for my query if it is a timestamp...tnx

Link to comment
Share on other sites

didn't work with this codes...

 

$startdate = mktime(0,0,0, $_POST[startMonth] $_POST[startDay] $_POST[startYear]);
$enddate = mktime(0,0,0,$_POST[EndYear] $_POST[EndMonth]$_POST[EndDate]);

 

in the following query start is a timestamp

$qryCDR = "SELECT DISTINCT * FROM cdr where clid like " . $Group . " and date(start) >= " . $startdate . " and date(start)< " . $enddate . "ORDER BY cdrid DESC";

 

need to get the data within a specific range...thanks

Link to comment
Share on other sites

didn't work with this codes...

 

That's not very descriptive. Are you getting errors? What are they? If you aren't getting errors, what is the value of $qryCDR.

 

What format are the month, day, and year fields? Are they numeric as the function requires? Did you look at the manual for that function? http://us2.php.net/manual/en/function.mktime.php

 

Help us to help you. If you make it too much of a chore you are less likely to get helpful advice.

Link to comment
Share on other sites

sorry got hanged up with higher priority issues here...and english language issues too...no errors..value of $qryCDR is as expected, for month, day, year it is numeric.yup i did looked at the manual...

 

  $startdate = mktime(0,0,0, $_POST[startMonth] $_POST[startDate] $_POST[startYear]);
  $enddate = mktime(23,59,59,$_POST[EndMonth] $_POST[EndDate]$_POST[EndYear]);

 

$startdate and $enddate end up with numeric values as expected.

 

however comparison to the start field seems doesn't work...i try to echo that field from a row...here's the format of start field....

   2007-07-24 11:46:55 

 

i believe it should be in numeric format too...that's the problem...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.