Welcome Guest, Not a member yet? Register   Sign In
problem learning CI
#16

[eluser]Hakkam[/eluser]
Hi Yusuf,

Please try debug it using print_r . Step by step



CONTROLLER

class Main extends Controller{


function index(){
$this->load->helper('form');
$this->load->view('profile');
}

function createProfile(){
$this->load->helper('url');
//if ($this->input->post('name')){
$this->load->model('Mprofile','',TRUE);
$this->Mprofile->addData();
redirect('main/myResult','refresh');
//}
//else{
// redirect('main/createProfile','refresh');
//}
}


function myResult(){
$this->load->helper('url');
$this->load->model('Mprofile', '', true);
$data['result'] = $this->Mprofile->getData();

Please try print_r in here then exit, to know if is there any data result.

print_r($data['result']);exit();

If any array result than try print_r in views


$data['page_title']="Yousuf";
$this->load->view('viewentry',$data);
}
}
?>


VIEW-2
<html>
<head>
<title><?=$page_title?></title>
</head>
<body>

please try print_r the result, is there any result data ?
print_r($result);exit();

<?php foreach($result as $row):?>
<h3>&lt;?=$row->name?&gt;</h3>
<p>&lt;?=$row->address?&gt;</p>
<h3>&lt;?=$row->phonenumber?&gt;</h3>
<p>&lt;?=$row->email?&gt;</p>
<h3>&lt;?=$row->occupation?&gt;</h3>
<p>&lt;?=$row->interests?&gt;</p>
<h3>&lt;?=$row->filename?&gt;</h3>

<br />
&lt;?php endforeach;?&gt;
&lt;/body&gt;
&lt;/html&gt;[/quote]


Messages In This Thread
problem learning CI - by El Forum - 07-14-2009, 01:54 AM
problem learning CI - by El Forum - 07-14-2009, 02:14 AM
problem learning CI - by El Forum - 07-14-2009, 02:24 AM
problem learning CI - by El Forum - 07-14-2009, 04:21 AM
problem learning CI - by El Forum - 07-14-2009, 08:51 PM
problem learning CI - by El Forum - 07-14-2009, 09:48 PM
problem learning CI - by El Forum - 07-15-2009, 01:08 AM
problem learning CI - by El Forum - 07-15-2009, 01:21 AM
problem learning CI - by El Forum - 07-15-2009, 01:22 AM
problem learning CI - by El Forum - 07-15-2009, 09:37 PM
problem learning CI - by El Forum - 07-15-2009, 09:40 PM
problem learning CI - by El Forum - 07-15-2009, 09:40 PM
problem learning CI - by El Forum - 07-15-2009, 09:57 PM
problem learning CI - by El Forum - 07-15-2009, 10:03 PM
problem learning CI - by El Forum - 07-15-2009, 11:11 PM
problem learning CI - by El Forum - 07-16-2009, 01:11 AM
problem learning CI - by El Forum - 07-16-2009, 03:51 AM
problem learning CI - by El Forum - 07-16-2009, 04:17 AM
problem learning CI - by El Forum - 07-16-2009, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB