Jump to content

adding a prefix to an autogenerated number


nicsnow

Recommended Posts

Hi I need to add a prefix letter to sequential numbers that are autogenerated (a bit like creating invoice numbers) the guilty party is called accom_id this knocks out a 5 digit number which now needs to be displayed in the end result -either as a client page or data entry- as 'e12345' as opposed to '12345' - guidance please! Code below:

 

<?

if ($session=='kill'){
session_unregister(accom_id);
unset($accom_id);
}
if (isset ($newclientid)){ 
$queryi = "UPDATE `accomm_main` SET 
			`clientid` = '$newclientid'				
			 WHERE `accomm_id` = '$accom_id' ";
			 //echo $queryi;
			$resulti=mysql_query($queryi,$conn);	
			$clientid= $newclientid;
}				
//really???? every bloody time???		
if (!isset ($accom_id)){
dbconnect(); 
$query = "INSERT INTO `accomm_main` ( `accomm_id` , `status` , `resnumber` , `hotelid` , `clientid` , `usr` , `commision` , `rack_rate` , `saving` , `financial_arr` , `room_inclusion` , `booking_cond` , `special_terms` , `special_fin_terms` , `unit`,  `type` ) 
VALUES (
NULL , '1',  '', '0', '0', '$username', '0.00', '0.00', '0.00', '', '', '', '', '', '$userunit', '$flagtype'
) ";
$result=mysql_query($query,$conn);	
  session_register ('accom_id');
  $accom_id=mysql_insert_id();
  //echo $accom_id;  
}

?>

<?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.