VALID or NOT??
Posted: Tue Feb 03, 2004 7:41 am
i just curious about this code below...
it just a snippet of code..
first i really curious about the MONTH function...is it valid??
the MONTH('{$senarai["waktuTamat"]}') means i want to fetch only month from the previous query...
and the
means i want to do IF to the id (month without leading zero) and the previous query...
why i curious is i can't get the output i want from this code...
anybody can help???
it just a snippet of code..
Code: Select all
$viewCheck=query("SELECT id FROM tempfailure WHERE id = MONTH('{$senarai["waktuTamat"]}') ORDER BY id", $link, __LINE__, __FILE__);
$periksa=mysql_fetch_array($viewCheck, MYSQL_ASSOC);
if (date("n",$senarai["waktuTamat"])==$periksa["id"])
{
$nilai=$periksa["jumlah"]+1;
$SQLupd=query("UPDATE tempfailure SET jumlah = '$nilai' WHERE id =MONTH('{$senarai["waktuTamat"]}')", $link, __LINE__, __FILE__);
}the MONTH('{$senarai["waktuTamat"]}') means i want to fetch only month from the previous query...
and the
Code: Select all
if (date("n",$senarai["waktuTamat"])==$periksa["id"])means i want to do IF to the id (month without leading zero) and the previous query...
why i curious is i can't get the output i want from this code...
anybody can help???