hi all
i have to create a registration form in which registration number is auto generated with A1 text with each number. i wrote custom code to retrieve data from database and increment by 1. but i am not getting any result getting a blank page , i think there is error in the code . need help, code is given below
thanks

$result = db_query("SELECT field_regno_value FROM {field_data_field_regno} order by entity_id desc limit 1 ");
$row = db_fetch_array($result);
$cur_val = "A1".$row["field_data_field_regno"]+1;
$entity_field[0]['value'] = $cur_val;