Jump to content

codeigniter, how to store into view


Yohanne

Recommended Posts

Hi coders,

 

code below are running good, but my problem is i did not get the line echo $row->pof_num + 1; into view "generate_po.php".

 

since i want that line to get the value and put into input text like below. how and kindly assist.

<input type = "text" name = "num" value = "<?php echo $row->pof_num + 1; ?>">
		public function generate_po()
			{
				$po_id = $this->input->post('selector');
				
				$data['result'] =  $this->public_base_model->generate_po($po_id);
		
					if($this->session->userdata('logged_in'))
						{
						  $session_data = $this->session->userdata('logged_in');
							$data['username'] = $session_data['username'];
								$data['fname'] = $session_data['fname'];
									$data['userid'] = $session_data['userid'];
										$this->load->view('generate_po', $data,$this->get_max());
						}
					else
						{
						 $this->load->view('login');
						}
			}
		public function get_max()
			{
				$query2 = $this->db->query("SELECT pof_num FROM pull_out where pof_num = '8800000582'");

				$row = $query2->row();
				
					echo $row->pof_num + 1; // i want this line to put into view.
					
				$query2->free_result();			
					
			}
Link to comment
https://forums.phpfreaks.com/topic/291943-codeigniter-how-to-store-into-view/
Share on other sites

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.