hello i wanted to build
I get $date and $date1 from form xxx. I wanted to make leave program.
now i wanted process $date with variable string with value xx-xx-xxxx(dd/mm/yyyy)and
$date1 with value now i want to convert them to date.
I already know how to count day using datediff()
i convert $date so i can use dateadd() function
Here the code
$t1 = substr($date,0,2);
$b1 = substr($date,3,2);
$y1 = substr($date,6,4);
$t2 = substr($date11,0,2);
$b2 = substr($date1,3,2);
$y2 = substr($date1,6,4);
$tawal ="$y1-$b1-$t1";
$takhir = "$y2-$b2-$t2";
$query = "SELECT datediff('$takhir', '$tawal')as selisih";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$times = $data['selisih'];
$times = + 1;
here the picture
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…