Auto increment
Posted: Mon Aug 25, 2014 1:23 am
Hi,
I'm trying to use the below code to auto increment a field. I added the hash variables for nuBuilderPro but it does not work.
Could you please advise?
I'm trying to use the below code to auto increment a field. I added the hash variables for nuBuilderPro but it does not work.
Code: Select all
if('#nu_cloned_record#' == '1' or '#RECORD_ID#' == '-1'){ //-- this is a new record
nuRunQuery("INSERT INTO recepcounter (extra_field) VALUES ('1')");
$s = "UPDATE reception SET reception_code = '" . mysql_insert_id() . "' ";
$s .= "WHERE reception_id = '#nu_new_record#'";
nuRunQuery($s);
}