CodeIgniter Forums
problem learning CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: problem learning CI (/showthread.php?tid=20543)

Pages: 1 2


problem learning CI - El Forum - 07-14-2009

[eluser]yousuf_007sys[/eluser]
I am having problems learning to use CI. i have basic knowledge on PHP and this is the first time I am using any kind of framework, if anyone can direct me to a simple sample website with codes, it would be a great help

reply

tc


problem learning CI - El Forum - 07-14-2009

[eluser]Thorpe Obazee[/eluser]
sample application: check out http://www.bambooinvoice.org


problem learning CI - El Forum - 07-14-2009

[eluser]Yousra[/eluser]
You can see the Video Tutorials ... it's very useful for your case


problem learning CI - El Forum - 07-14-2009

[eluser]TheFuzzy0ne[/eluser]
And my [url="http://ellislab.com/forums/viewthread/107773/"]CodeIgniter Resources thread[/url] might help.


problem learning CI - El Forum - 07-14-2009

[eluser]yousuf_007sys[/eluser]
can any one please give me a really small piece of work designed with CI having php, mysql, html codes--something like getting information from the user and saving on a database and viewing it later(something like a profile entry and retrieving)


problem learning CI - El Forum - 07-14-2009

[eluser]John_Betong[/eluser]
[quote author="yousuf_007sys" date="1247644315"]can any one please give me a really small piece of work designed with CI having php, mysql, html codes--something like getting information from the user and saving on a database and viewing it later(something like a profile entry and retrieving)[/quote]
 
What I did and it may well work with yourself is to:
 
1. pick a subject or hobby that is familiar and well known to yourself (no learning curve).
 
2. copy and rename the CI Welcome controller and view.
 
3. Gradually add MySql, forms, models, helpers, libraries and other features.
 
4. Get the general feel for the framework.
 
 
Search this forum and Wiki, try the example code. If you cannot get the code to work then explain what you have tried and ask for advice on the forum.
 
 
 


problem learning CI - El Forum - 07-15-2009

[eluser]yousuf_007sys[/eluser]
As far I understand from the controller I need to call the View where the user will input some information, the information needs to be transfered back to controller which will be send to Model to store on the database.

I can't figure out how I can send information from the view to Model via controller


problem learning CI - El Forum - 07-15-2009

[eluser]HelpGame[/eluser]
Hello TC,

I am starting to learn CI too!

But I have not been able to even get the Welcome screen up.


My understanding is that all I need to do is set my baseurl,
and I should get the welcome screen.


Is that what you did?


What HOST are you hosting CI on?


Does anyone else have know ANY HOST where you can just set your
baseurl, and you will get your welcome screen?



Thanks for your help!


David



problem learning CI - El Forum - 07-15-2009

[eluser]jayrulez[/eluser]
[quote author="yousuf_007sys" date="1247659680"]As far I understand from the controller I need to call the View where the user will input some information, the information needs to be transfered back to controller which will be send to Model to store on the database.

I can't figure out how I can send information from the view to Model via controller[/quote]

data that will be sent to the model via controller is data entered in forms and the like


problem learning CI - El Forum - 07-15-2009

[eluser]yousuf_007sys[/eluser]
I can enter the data on my database but when I try to retrieve I am having the following problem.I am getting the following error, please help me to solve this problem and find attached the codes below with the error.

ERROR

A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: controllers/main.php

Line Number: 29

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();
$data['page_title']="Yousuf";
$this->load->view('viewentry',$data);
}
}
?>


VIEW-2
<html>
<head>
<title><?=$page_title?></title>
</head>
<body>
<?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;