I want to insert 2 strings data to 1 colomn(combine) in my database.
This is my proccess code.
models:
public function edit_code($input_id,$input_name, $input_code){
$data['name'] = $input_name;
$data['code'] = $input_code;
$this->db->where('id',$input_id);
$this->db->update('code',$data);
}
view :
<div>
<div>
<h2>Edit Code:</h2>
<div>
<?php echo form_open('login/edit_code');?>
<?php
$codeLAT= 'KUCK';
$input_name = array(
'name' => 'input_name',
'class' => 'forminput',
'size' => '30'
);
$input_code = array(
'name' => 'input_code',
'class' => 'forminput',
'size' => '30'
);
?>
<span>Name</span>: <?php echo form_input($input_name,$page['name']) ?><br/>
<span>Code</span>: <?php echo $codeLAT , form_input($input_code,$page['code']) ?>
<?php echo form_hidden('input_id',$page['id']);?>
<?php echo form_submit('submit', 'Submit', 'class=buttonss'); ?>
<?php echo form_close();?>
</div>
controler :
public function save_edit_code(){
$this->check_logged_in();
$codeLAT = 'KUCK';
$input_id = $_POST['input_id'];
$input_name = $_POST['input_name'];
$input_code = ($_POST[$codeLAT]. '' .$_POST['input_code']);
$this->Promo_model->edit_promo($input_id,$input_name, $input_code);
redirect('login/codepage');
}
In here i want to combine $codeLAT with $inputcode
Example :
Script :
$input_code = ($_POST[$codeLAT]. '' .$_POST['input_code']);Save in my database colomn
code:KUCK009912
But in my code, my form just save $inputcode in my colomn database. Not include $codeLAT.
In my example just save 009912.
input_codefield type, if its anumberthen you cannot store string, so change it tovarcharand it will work.input_codeits succesfull save to my database. But thecodeLATnot save. For example my system must saveKUCK00912, but just00912save it in my colomncode