new_php85 Posted June 19, 2009 Share Posted June 19, 2009 hye everybody... here i have problem to share with u... can u guys help me to solve that problem... i want update but field date cannot be update why??? u guys got an idea??? here some code taht you can refer... <?php $value_K=$_POST['id_cemas']; $inputDate1K=$_REQUEST["tmula1_K"]; $split1K = explode("-", $inputDate1K); $NewDate1K= "" . $split1K[2] . "-" .$split1K[1]. "-" .$split1K[0] ; $i=$_REQUEST["a"]; $sqlK1=mysql_query("update t_pinjaman set tarikh_mula_potong='$NewDate1K[$i]' where id_t_pinjaman='$value_K[$i]'",$link); ?> <table width="759" border="1" align="center"> <!--DWLayoutTable--> <?php $sql7=mysql_query("select id_pinjaman,jumlah_diluluskan,jumlah_pinjaman,tempoh_pinjaman,potongan_sebulan, date_format(tarikh_mula_potong,'%d-%m-%Y') as tarikh_mula,date_format(tarikh_kemaskini_proses,'%m') as bulan, id_t_pinjaman from t_pinjaman where no_ahli='".$_REQUEST["no_ahli"]."' and date_format(tarikh_kemaskini_proses,'%Y')='".$_REQUEST["tahun"]."' and date_format(tarikh_kemaskini_proses,'%m')='".$_REQUEST["bulan"]."' and status_permohonan !='0' and id_pinjaman='K'",$link); $bil_K=0; while(list($pinjaman,$jumlah,$jum_pjm,$tempoh,$potongan,$tarikh_mula,$tarikh,$id_t_pinjam)=mysql_fetch_row($sql7)) { if($tarikh==$_REQUEST["bulan"]) { $P1_1pengguna=$pinjaman; $P1_1tmula=$tarikh_mula; $id_cemas=$id_t_pinjam; } ?> <tr><th bordercolor="#000000" class="style49"><input name="tmula1_K[]" type="text" id="tmula1_K[]" size="10" value="<?php echo $P1_1tmula; ?>" /> <a href="javascript:NewCal('tmula1_K[]','ddmmyyyy')"><img src="images/cal.gif" alt="Pilih Tarikh" name="tarikh" width="19" height="16" border="0" id="tarikh" /></a> </th> <th bordercolor="#000000" class="style49"><input name="id_cemas[]" type="text" id="id_cemas[]" value="<?php echo $id_cemas; ?>" size="10" /> <a href="javascript:update(<? echo $bil_K;?>)" ><img src="images/edit.gif" alt="Edit Rekod" width="18" height="16" border="0"></a></th></tr> <?php $bi_K++; } </table> Link to comment https://forums.phpfreaks.com/topic/162892-date-arrayplz-help-me/ Share on other sites More sharing options...
joel24 Posted June 19, 2009 Share Posted June 19, 2009 what error do you get? i'm assuming your date format will be incorrect... the default mysql date format is YYYY-MM-DD Link to comment https://forums.phpfreaks.com/topic/162892-date-arrayplz-help-me/#findComment-859495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.