在codeigniter

时间:2016-01-27 11:56:17

标签: codeigniter

我在另一页学生信息中再次检索时遇到了问题。

我可以通过模型和视图查看所有使用此项目的学生:

 public function viewdata()
	{
               $this->db->order_by("Idnumber", "asc");
		$query= $this->db->get('studentinformation');
                return $query->result();
  
	}
  <table class=" table table-hover ">
            
               
		         <thead>
                             <tr>
                             
                                   <th>ID Number</th>
                                   <th>Firstname</th>
                                   <th>Middlename</th>
                                   <th>Lastname</th>
                                   <th>Sex</th>
                                   
                           </tr>
                      </thead>
    
    
    <?php
      	
			foreach($this->model_adminlogin->viewdata() as $row){
                            
                            
                            ?>
    
    
    
    
    <tbody>
          <tr>
                  
                   
                   <td><?php echo $row->Idnumber?></td>
                   <td><?php echo $row->Firstname?></td>
                   <td><?php echo $row->Middlename?></td>
                   <td><?php echo $row->Lastname?></td>
                   <td><?php echo $row->Sex ?></td>
                             <td>
                                 <a href="<?php echo site_url('viewstudentinalpha/viewspecific/'.$row->Id) ?>" class="btn btn-info" type="submit" name="submit" role="button">Option</a>
      
                             </td>
         </tr>
      </tbody>
		 
                

				
			  <?php
			  }
			
			
                        
        
                         ?>		
			</table>

我也可以在模型和控制器中查看每个学生的信息并查看:

  function getonerow($id)
	{
		$this->db->where('Id',$id);
		$query=$this->db->get('studentinformation');
		return $query->row();
	}

public function viewspecific($id)
	{
       if($this->session->userdata('logged_in'))
        {
     $this->output->set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     $this->output->set_header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
     $this->output->set_header('Cache-Control: post-check=0, pre-check=0', FALSE);
     $this->output->set_header('Pragma: no-cache');
           $session_data = $this->session->userdata('logged_in');
           
           $data['Username'] = $session_data['Username'];
           $row=$this->model_adminlogin->getonerow($id);
           $data['r']=$row;
	   $this->load->view('individualviewstudent',$data);
        } else{
            redirect('welcome', 'refresh');
        }
        if((!isset($session_data) || $session_data !=TRUE)) {
          
            redirect('welcome', 'refresh');
        }
		
		
	}

并使用$ r查看

<label class="z  label-primary">Name:</label> <span class="z">&nbsp; <?php  echo $r -> Firstname." ". $r-> Middlename." ".$r-> Lastname; ?></span><br>
        
             </div>
             <div class="spacesz">
         <label class="z label-primary">Id Number: </label><span class="z">&nbsp;<?php echo $r->Idnumber; ?></span>
             </div>
              <div class="spacesz">
             <label class="z label-primary">Age:</label><span class="z">&nbsp;<?php echo $r-> Age; ?></span>
              </div>
etc.......................................................................................

我现在的问题如何再次检索到该学生的另一个视图页面我点击了我的更新目的?这是我对问题的看法 - &gt; retrieve in another page of that student

1 个答案:

答案 0 :(得分:0)

使用对象Main.hs:10:3: Could not deduce (TokenParsing t0) arising from a use of ‘emptyIdents’ from the context (TokenParsing m) bound by the type signature for identStyle :: TokenParsing m => IdentifierStyle m at Main.hs:8:15-49 The type variable ‘t0’ is ambiguous Note: there are several potential instances: instance attoparsec-0.13.0.1:Data.Attoparsec.Internal.Types.Chunk t => TokenParsing (attoparsec-0.13.0.1:Data.Attoparsec.Internal.Types.Parser t) -- Defined in ‘Text.Parser.Token’ instance TokenParsing Text.ParserCombinators.ReadP.ReadP -- Defined in ‘Text.Parser.Token’ instance TokenParsing m => TokenParsing (Unhighlighted m) -- Defined in ‘Text.Parser.Token’ ...plus 11 others In the expression: emptyIdents In the expression: emptyIdents {_styleStart = letter, _styleLetter = letter} In an equation for ‘identStyle’: identStyle = emptyIdents {_styleStart = letter, _styleLetter = letter} Failed, modules loaded: none. 中的可用ID。

string profilesRoot = "Software\\Microsoft\\Office\\15.0\\Outlook\\Profiles";
Registry.CurrentUser.OpenSubKey(profilesRoot).GetSubKeyNames()

将上述代码放入“更新学生”链接中。如下所示:

$r
相关问题