J
|
Jane 10/17/2006 |
Hi, function BeforeAdd(&$values) { global $conn; $strSQL1= "select date_format('".$values["date"]."', '%y')"; $rs1 = db_query($strSQL1,$conn); $data1 = db_fetch_numarray($rs1); $year = $data1[0]; $strSQL2 = "select count(*) from Order where state='".$values["state"]."'"; $rs2 = db_query($strSQL2, $conn); $data2 = db_fetch_numarray($rs2); $sum = $data2[0]+1; $values["jobid2"] = $values["state"]."-".$year."-".$sum; return true; } |
|
jwoker author 10/19/2006 |
I'm not getting the date to come through. Where the code goes: |
J
|
Jane 10/19/2006 |
Peter, $tm = db2time($values["date"]); $year = $tm[0]; |