如何在codeigniter中从数据库中获取数组的值



我有一段代码,可以从数据库中获取数组中的值,如下所示:

$uri = $this->uri->uri_to_assoc(4);
$student_id='S17AB21017';
$data['profile_data']=$this->studentsmodel->get_Cinprofile($student_id);

$pay = $this->instamojo->pay_request( 
$amount = "6930" , 
$purpose = "Primary Colors Internationals" , 
$buyer_name = "Apple" , 
$email = "webteam6@marrs.in" , 
$phone = "7034805760" ,
$send_email = 'TRUE' , 
$send_sms = 'TRUE' , 
$repeated = 'FALSE'
);

我想得到$buyer_name$email$phone$data值,并在pay_request((中给出。姓名、电子邮件和电话的值从表students_to_cin中获取。如何获取这些值?

get_Cinprofile()的代码如下所示:

public function get_Cinprofile($student_id)
{
//echo $student_id;die;
$this->db->select('students_to_cin.*,schools.school_name,schools.school_address,schools.school_address1,schools.school_email,schools.school_phone,schools.school_principal_name,schools.school_medium,states.state_subdivision_name,class.class_key,category.categoryKey,period.period_name,countries.country_name,studentlist.stud_cin,studentlist.stud_syllabus,studentlist.stud_school_state,studentlist.stud_school_country,schools.school_pincode');
$this->db->from('students_to_cin');
$this->db->join('schools','schools.school_id=students_to_cin.school_id');
$this->db->join('states','states.state_subdivision_id=students_to_cin.state_id');
$this->db->join('class','students_to_cin.class_id = class.class_id'); /*class.class_key,*/
$this->db->join('category','students_to_cin.category_id = category.category_id');
$this->db->join('period','students_to_cin.period_id = period.period_id');
$this->db->join('countries','students_to_cin.country_id = countries.country_id');
$this->db->join('studentlist','students_to_cin.cin = studentlist.stud_cin');
$this->db->where('students_to_cin.student_id',$student_id);
$query = $this->db->get();//echo $this->db->last_query();exit;
$result = $query->row_array(); 
return $result;
}

有人能帮我吗?

您可以像…一样使用它。。。。。

$uri = $this->uri->uri_to_assoc(4);
$student_id='S17AB21017';
$data['profile_data']=$this->studentsmodel->get_Cinprofile($student_id);

$pay = $this->instamojo->pay_request( 
$amount = $data['profile_data']['yourfieldname'] , 
$purpose = $data['profile_data']['yourfieldname'] , 
$buyer_name = $data['profile_data']['yourfieldname'] , 
$email = $data['profile_data']['yourfieldname'] , 
$phone = $data['profile_data']['yourfieldname'] ,
$send_email = $data['profile_data']['yourfieldname'] , 
$send_sms = $data['profile_data']['yourfieldname'] , 
$repeated = $data['profile_data']['yourfieldname']
);

相关内容

  • 没有找到相关文章

最新更新