Welcome Guest, Not a member yet? Register   Sign In
Ajax/Jquery with Codeigniter Doesn't Access Controller??
#2

[eluser]Kraig[/eluser]
I got it to work. Below is the code for the controller function:
Code:
public function jquery(){
  $userID = $this->session->userdata('id');
  $query = $this->db->query('SELECT * FROM upload WHERE userID = '.$userID);
  $num_rows = $query->num_rows();
  $val = $query->row_array();    
  
  $output_string = "";  
  
  foreach ($query->result() as $row){
   $output_string .= $row->id;
   $output_string .= " ".$row->name."<br />";
  }
          
        echo json_encode($output_string);
  
    }


Messages In This Thread
Ajax/Jquery with Codeigniter Doesn't Access Controller?? - by El Forum - 08-16-2012, 12:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB