wsantos Posted July 24, 2007 Share Posted July 24, 2007 Guys i need a form to submit timestamp from a calendar...thanks in advance Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 24, 2007 Share Posted July 24, 2007 Are you looking for someone to write it for you? You'll want to go here for that: http://www.phpfreaks.com/forums/index.php/board,8.0.html Here, you need to post code for us to help with. Quote Link to comment Share on other sites More sharing options...
wsantos Posted July 24, 2007 Author Share Posted July 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 24, 2007 Share Posted July 24, 2007 Nothing wrong with using your input boxes for the three parameters. Just use mktime() on the server-side to convert to a timestamp. $timestamp = mktime( 0, 0, 0, $month $day $year); Quote Link to comment Share on other sites More sharing options...
wsantos Posted July 24, 2007 Author Share Posted July 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 24, 2007 Share Posted July 24, 2007 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. Quote Link to comment Share on other sites More sharing options...
wsantos Posted July 24, 2007 Author Share Posted July 24, 2007 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... Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 24, 2007 Share Posted July 24, 2007 I think the problem may be the field type in the database. Take a look at this post concerning MySQL/PHP date handling and see if it helps. http://www.phpfreaks.com/forums/index.php/topic,95430.0.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.