seetz10
03-05-2004, 05:34 PM
hi,
I want to use a date that is selected in a drop down by the user from
a previous page in a sql query.
The date is $thedate and in the format eg 12/04/2004 when i post the
value.
$thedate = $_POST[sel_date];
but because the format is in a string i cannot compare it to a value in my
table in the database because the value in the databse is in the format 2004-04-12.
I have tried to use this ....
$datearray = getdate($thedate);
foreach ($datearray as $key => $val)
{
print "$key= $val<br>";
}
But i just get the unix epoch value. I guess this is because the arguement
for getdate() is not a not a timestamp but a string.
Can anyone help me figure what i can do to solve this problem.
Thanks
I want to use a date that is selected in a drop down by the user from
a previous page in a sql query.
The date is $thedate and in the format eg 12/04/2004 when i post the
value.
$thedate = $_POST[sel_date];
but because the format is in a string i cannot compare it to a value in my
table in the database because the value in the databse is in the format 2004-04-12.
I have tried to use this ....
$datearray = getdate($thedate);
foreach ($datearray as $key => $val)
{
print "$key= $val<br>";
}
But i just get the unix epoch value. I guess this is because the arguement
for getdate() is not a not a timestamp but a string.
Can anyone help me figure what i can do to solve this problem.
Thanks