Welcome Guest, Not a member yet? Register   Sign In
[solved]Strange problem with my retrieval record function:
#1

[eluser]brucebat[/eluser]
WAS CAUSED BY CORRUPTED DATABASE


Hi all,

I am experiencing a strange problem with my view record function.

Screenshot:

http://i.imgur.com/tyGvE.jpg

When I click the view button , it is saying no record returned however there is a record there otherwise my view would not generate that button.

The only time it works is on record #3. Why work on no.3

Here is just a screenshot to prove there is data
http://i.imgur.com/pBzVs.jpg

I have checked the view code and it is fine, I have a feeling it is the database or my query functions:

Here is the controller:

Code:
public function view_record()
        {
            $record_id = $this->input->post('procedure_id');
            
            $returned_record = $this->control_panel_model->view_record($record_id);
            

                         if ($returend_record->num_rows() > 0)
{
            foreach ($returned_record->result() as $row)
            {
                echo $row->name_id; //to test this works
                echo "hello";
            }
    }
                      else
                     {
                          echo "No records";
                     }
            return;
        }

Model function:

Code:
public function view_record($record_id)
        {
            $criteria = array
            (
                'procedure_id' => $record_id
            );
            
            $this->db->select('procedure.procedure_id, procedure.patient_id, procedure.department_id, procedure.name_id , procedure.dosage_id');
            $this->db->from ('procedure');
            
            $this->db->join('patient', 'patient.patient_id = procedure.patient_id', 'inner');
            $this->db->join('department', 'department.department_id = procedure.department_id', 'inner');
            $this->db->join('procedure_name', 'procedure_name.procedure_name_id = procedure.name_id', 'inner');
            $this->db->join('dosage', 'dosage.dosage_id = procedure.dosage_id', 'inner');
            
            $this->db->where('procedure_id', $record_id);
            $result = $this->db->get();
            
        
            return $result;


        }

So what do you think is wrong?

Thanks


Messages In This Thread
[solved]Strange problem with my retrieval record function: - by El Forum - 07-31-2011, 11:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB