I don't know, how to change date from database into array.
Can someone help me to fix it? Please find below my code :
require ('sss_connection.php');
$koneksi = mysql_connect($server,$user,$pass);
$db=mysql_select_db($db);
$sql7="select tanggallibur from harilibur";
$ambil_data7=mysql_query($sql7);
while($data= mysql_fetch_array($ambil_data7))
{
$tanggal_libur = $data['tanggallibur'];
}
$tglLibur = array($tanggal_libur);
$data['tanggallibur']
is date in database
I expected for is to reduce the working day by day off, example = 2015-01-01 until 2015-01-08 weekdays obtained is 5 days, this has included cutting the saturday and Sunday. i know how to cut working day for saturday and sunday, but i dont know how to cut working day with offday (holiday).
Do you want to assign database column to a separate array ? then you want to change
$tanggal_libur = $data['tanggallibur'];
to
$tanggal_libur[] = $data['tanggallibur'];
and the complete code would be
require ('sss_connection.php');
$koneksi = mysql_connect($server,$user,$pass);
$db=mysql_select_db($db);
$sql7="select tanggallibur from harilibur";
$ambil_data7=mysql_query($sql7);
while($data= mysql_fetch_array($ambil_data7))
{
$tanggal_libur[] = $data['tanggallibur'];
}
print_r($tanggal_libur);