Hi,
I am having a problem trying to get the first X digits of an date.
This is what I use:
$today = date("Ymd");
// creates 20020528
$part_of_today = substr("$today" ,0 ,6);
// creates 200205
then I use that to query mySQL database like this:
$result1=mysql_query("select * from fact WHERE f_st='1' AND f_h LIKE '$part_of_today %' ORDER BY f_h ASC",$link);
// it should show a list of fields that have the date 200205** but it doesn't show any result.
I tried to modify the substr and put this: $part_of_today = substr("$today" ,0 ,4);
// creates 2002
and In THAT case MySQL query gave me results... anybody can tell me what I am doing wrong?
thanks for all.