<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">CodeIgniter Forums</title>
    <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/" />
    <link rel="self" type="application/atom+xml" href="http://codeigniter.com/forums/atom/" />
    <updated></updated>
    <rights>Copyright (c) 2008</rights>
    <generator uri="http://www.pmachine.com/" version="1.6.3">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2008:08:29</id>


    <entry>
      <title>Need DB, Model, IgnitedRecord guidance</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89610/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89610</id>
      <published>2008-08-29T18:57:38Z</published>
      <updated></updated>
      <author><name>mahalie</name></author>
      <content type="html">
      <![CDATA[
        <p>I have scanned some DB threads and am very excited to use IgnitedRecord.
</p>
<p>
I have never used rails and in fact am most used to MS SQL and using views or stored procedures to do model stuff - new to MVC also. So, given that I know DB/SQL well but am not at all familiar with this style of programming - where would you suggest I start? (Just to make things hard, am also having to refresh on PHP...heheh...but syntax seems ok so far)
</p>
<p>
I am trying to build a very simple application but am not sure how to approach the relational nature of the DB for CRUD.
</p>
<p>
<b>If I understand correctly (so far), you create Models to automate a lot of joining and special SQL queries yes? And then something like IgnitedRecord could automate things further to automate the enforcing of relationships like cascading deletes and updates?</b>
</p>
<p>
Any input, reference to tutorial, video, proper manual chapter, etc would be helpful. <b>A very simple tutorial using a relational data would be ideal!</b>
</p>
<p>
Thanks in advance.&nbsp;  <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" />
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>I&#8217;m at a standstill&#8230;.need help with controllers (theory)</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89573/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89573</id>
      <published>2008-08-29T13:34:04Z</published>
      <updated></updated>
      <author><name>jleequeen</name></author>
      <content type="html">
      <![CDATA[
        <p>I feel like I&#8217;m beating a dead horse but I&#8217;m stuck so here goes.&nbsp; I&#8217;ve asked questions about controllers in these forums before and while I get good suggestions, I still am confused on the subject.&nbsp; I&#8217;m very comfortable with models and views.&nbsp; To me those are easy.&nbsp; But controllers still mystify me, because there really is no best practice to creating them.
</p>
<p>
On one hand, it seems much easier to design your controllers with a specific view in mind.&nbsp; One controller per view.&nbsp; That seems right, but only because I come from a spaghetti code background where the controller was nothing more than a snippet at the top of the view file. What it did was allow me to keep the controller very small and very focused.
</p>
<p>
On the other hand, I could have a &#8220;user&#8221; controller that does many things.&nbsp; Only thing is, at what point does it stop growing.&nbsp; At least when you are using a one controller per view scenario it keeps your focus small and close to that particular view, so the view decides how that particular controller grows.
</p>
<p>
I use to design by user interface, letting the views tell me what needed to be in the controller but I really want to be more clean and structured and that is why I&#8217;ve been working with CI.
</p>
<p>
I just get confused, because view-centric design seems easy but looking at controllers in terms of objects per say almost makes me think of each controller as a little app in itself that does many things. Like user/add, user/edit, user/delete, user/profile, user/login, user/logout.&nbsp; At what point do you stop and say wait a minute, why have lots of functionality in one large controller class (which will keep growing with time) when all you need is one method for one view, but you are loading in all that extra controller code that won&#8217;t be used on that particular request.&nbsp; It just seems to me that by grouping things that might seem logical at first into one controller, down the road it would have been better to be small and discrete.
</p>
<p>
Maybe I&#8217;m just not understanding the approach and why it&#8217;s good to have all these different methods in one controller.&nbsp; I tend to think in terms of user interface and that drove my design and kept my controllers very narrow and focused (albeit spaghetti code).
</p>
<p>
For me it comes down to the following scenarios.
</p>
<p>
1) Design with one controller per view and keep things small and discrete.&nbsp; It would be nice to hear from someone that put this into practice and find out how they liked this philosophy.
</p>
<p>
2) Design based off objects which normally means looking at your database and creating a controller for each &#8220;object&#8221; and putting all the functions that can manipulate that object in one controller.&nbsp; Possibly spread across a couple controllers I guess, but to me that&#8217;s when it gets fishy because I don&#8217;t think using the model is a good way to represent how your application should be divided up.
</p>
<p>
3) Create controllers based on the way you logically want to break up your application, that really has nothing to do with how the model is setup.&nbsp; Looking at it through a URL perspective maybe and how to group things together.
</p>
<p>
The second scenario is where I have the most trouble, because I feel like controllers can easily lose scope and become not what they were intended, like little apps themselves.&nbsp; I&#8217;m ready for someones $0.02 on the subject.
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Can&#8217;t login with Freakauth</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/72893/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.72893</id>
      <published>2008-02-28T12:00:35Z</published>
      <updated>2008-02-28T14:11:57Z</updated>
      <author><name>flokky</name></author>
      <content type="html">
      <![CDATA[
        <p>I&#8217;m having some problems with CI 1.6.1 and FreakAuth. Everything worked great, just until yesterday. I already used a compare tool, to compare my code, to a fresh instance and there were some differences, but they were all related to configuration (database) and modifications (fckeditor in formhelper)
</p>
<p>
When I enter the correct username and password, I get the same login screen.
<br />
When I enter the wrong username and/or password, I get a notification that I&#8217;ve entered an &#8216;invalid username or password&#8217;.
</p>
<p>
I&#8217;ve debugged through the code, placed some echo&#8217;s and it seems that CI can find the user in the backend database.
</p>
<p>
Second problem: when I try to show a message (flashmessage as called in code) like this.
</p>
<p>
Controller:
<br />
</p><div class="codeblock"><code>
//set a flash message<br /></span><span style="color: #0000BB">$msg </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">affected_rows</span><span style="color: #007700">().</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">lang</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">line</span><span style="color: #007700">(</span><span style="color: #DD0000">'FAL_text_added'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">flashMsg</span><span style="color: #007700">(</span><span style="color: #0000BB">$msg</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #DD0000">'admin/texts'</span><span style="color: #007700">, </span><span style="color: #DD0000">'location'</span><span style="color: #007700">);</span>
</code></div><p>
</p>
<p>
View:
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&lt;?php<br />$flash</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">db_session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flashdata</span><span style="color: #007700">(</span><span style="color: #DD0000">'flashMessage'</span><span style="color: #007700">);<br />if (isset(</span><span style="color: #0000BB">$flash</span><span style="color: #007700">) AND </span><span style="color: #0000BB">$flash</span><span style="color: #007700">!=</span><span style="color: #DD0000">''</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">&#123;?&gt;<br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">div id</span><span style="color: #007700">=</span><span style="color: #DD0000">"flashMessage"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?</span><span style="color: #007700">=</span><span style="color: #0000BB">$flash?&gt;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&lt;?php &#125;?&gt;</span>
</code></div><p>
</p>
<p>
This doesn&#8217;t show up in HTML. I&#8217;m sure I&#8217;ve loaded the language file. I&#8217;ve already tried with passing a hardcoded string. And tried echoing the flashdata(&#8217;flashMessage&#8217;), but that was just an empty string.
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>&#8216;welcome&#8217; not showing up as expected</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89602/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89602</id>
      <published>2008-08-29T17:36:25Z</published>
      <updated>2008-08-29T17:37:03Z</updated>
      <author><name>NateL</name></author>
      <content type="html">
      <![CDATA[
        <p>I did a fresh upload to a folder on my domain, mydomain.com/test
</p>
<p>
However, when I go to mydomain.com/test, I get the CI 404.&nbsp; when I go to mydomain.com/test/welcome, i get the proper welcome page that comes with CI
</p>
<p>
for my .htaccess, I have this code:
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">Options </span><span style="color: #007700">-</span><span style="color: #0000BB">indexes<br />DirectoryIndex index</span><span style="color: #007700">.</span><span style="color: #0000BB">php<br />RewriteEngine On<br />RewriteBase </span><span style="color: #007700">/</span><span style="color: #0000BB">test</span><span style="color: #007700">/<br /></span><span style="color: #0000BB">RewriteCond </span><span style="color: #007700">%</span><span style="color: #0000BB">&#123;REQUEST_FILENAME&#125; </span><span style="color: #007700">!-</span><span style="color: #0000BB">f<br />RewriteCond </span><span style="color: #007700">%</span><span style="color: #0000BB">&#123;REQUEST_FILENAME&#125; </span><span style="color: #007700">!-</span><span style="color: #0000BB">d<br />RewriteRule </span><span style="color: #007700">^(.*)$ </span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">?$</span><span style="color: #0000BB">1 &#91;L&#93;</span>
</code></div><p>
</p>
<p>
config.php:
<br />
$config[&#8217;base_url&#8217;] = &#8220;http://mysite.com/test/&#8221;;
</p>
<p>
routes.php
<br />
$route[&#8217;default_controller&#8217;] = &#8220;welcome&#8221;;
</p>
<p>
Everything else is pretty much default&#8230;
</p>
<p>
When I go to mysite.com/test, am I supposed to see Welcome first? or is everything set up properly if I go to mysite.com/test/welcome ?
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Simple search engine (POST or URI&#63;)</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89599/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89599</id>
      <published>2008-08-29T17:16:32Z</published>
      <updated></updated>
      <author><name>mvdg27</name></author>
      <content type="html">
      <![CDATA[
        <p>Hi there,
</p>
<p>
On my website I&#8217;d like to implement a simple search engine. All very basic. Creating the controller to search the database and display the results, shouldn&#8217;t be a problem.
</p>
<p>
I do however would like some input on how to pass the search query to my controller. As far as I can see I have two different options:
</p>
<p>
1) Use post data, which off course will be be available as de search query in my controller
<br />
2) Append the search query to my url, as such: &#8220;domains.com/search/my search query&#8221;
</p>
<p>
The first options probably is the easiest, the second one looks very interesting as the query is part of the URL, so it can be bookmarked, copy pasted etc.
</p>
<p>
The second option does cause some problems with disallowed charachters. Several characters (+ signs, accents, quotes, ampersands, commas etc.) are not allowed by default, but could very well be part of a user&#8217;s search query ..
</p>
<p>
Does anyone have any advice on how to handle this?
</p>
<p>
Thanks! -Michiel
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>CSS Question</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89596/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89596</id>
      <published>2008-08-29T16:43:20Z</published>
      <updated></updated>
      <author><name>NateL</name></author>
      <content type="html">
      <![CDATA[
        <p>Do you create a view for Headers and then bring that view into other views?&nbsp; I ask because I am creating an app that will use the same stylesheet through out the whole site, and it makes no sense to call in the same stylesheet for every page.
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>How to access uploaded text file for site verification&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89594/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89594</id>
      <published>2008-08-29T16:10:43Z</published>
      <updated></updated>
      <author><name>mudanoman</name></author>
      <content type="html">
      <![CDATA[
        <p>I am curious how I would go about allowing access to an uploaded text file for site verification.&nbsp; Some sites require site verification by uploading a text file to the site root.&nbsp; However, with CodeIgnitor the uploaded txt file does not seem accessible.&nbsp; Is there a work around to this?
</p>
<p>
Thanks.
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>validation, radio button, and loops&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89558/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89558</id>
      <published>2008-08-29T10:51:47Z</published>
      <updated></updated>
      <author><name>alanphil</name></author>
      <content type="html">
      <![CDATA[
        <p>In my view I&#8217;m creating a list of concerts, like this:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #0000BB">&lt;?php </span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$concerts </span><span style="color: #007700">as </span><span style="color: #0000BB">$row</span><span style="color: #007700">): </span><span style="color: #0000BB">?&gt;<br /><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">input type</span><span style="color: #007700">=</span><span style="color: #DD0000">"radio" </span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #DD0000">"concert_selection" </span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;?=$row-&gt;id?&gt;"</span><span style="color: #007700">&gt;&amp;</span><span style="color: #0000BB">nbsp</span><span style="color: #007700">;</span><span style="color: #0000BB">&lt;?</span><span style="color: #007700">=</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">concert_name?&gt;</span><span style="color: #007700">, </span><span style="color: #0000BB">&lt;?</span><span style="color: #007700">=</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">concert_date?&gt;</span><span style="color: #007700">, </span><span style="color: #0000BB">&lt;?</span><span style="color: #007700">=</span><span style="color: #0000BB">$row</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">count?&gt; pair</span><span style="color: #007700">(</span><span style="color: #0000BB">s</span><span style="color: #007700">) </span><span style="color: #0000BB">of tickets available</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br </span><span style="color: #007700">/&gt;<br /><br /></span><span style="color: #0000BB">&lt;?php </span><span style="color: #007700">endforeach; </span><span style="color: #0000BB">?&gt;</span>
</code></div><p>
</p>
<p>
I&#8217;m trying to add validation to keep the selected radio button selected, if some other field fails validation. I&#8217;ve tried many variations of the following from the user guide:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">input type</span><span style="color: #007700">=</span><span style="color: #DD0000">"radio" </span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #DD0000">"myradio" </span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"1" </span><span style="color: #0000BB">&lt;?php </span><span style="color: #007700">echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">validation</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set_radio</span><span style="color: #007700">(</span><span style="color: #DD0000">'myradio'</span><span style="color: #007700">, </span><span style="color: #DD0000">'1'</span><span style="color: #007700">); </span><span style="color: #0000BB">?&gt; </span><span style="color: #007700">/&gt;</span>
</code></div><p>
</p>
<p>
When I try the following, the radio button isn&#8217;t set after validation: 
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #0000BB">&lt;?php </span><span style="color: #007700">echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">validation</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set_radio</span><span style="color: #007700">(</span><span style="color: #DD0000">'concert_selection'</span><span style="color: #007700">, </span><span style="color: #DD0000">"&lt;?=$row-&gt;id?&gt;"</span><span style="color: #007700">); </span><span style="color: #0000BB">?&gt;</span>
</code></div><p>
</p>
<p>
I&#8217;ve tried many variations of the above. What am I missing?
</p>
<p>
Alan
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Session checking &amp;amp; loading a new view depending on the result</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89564/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89564</id>
      <published>2008-08-29T12:00:58Z</published>
      <updated></updated>
      <author><name>Aniesh</name></author>
      <content type="html">
      <![CDATA[
        <p>Hello All,
</p>
<p>
I am new to CI and now working with Session Management. I have to check the save the data in the Session and load a new view after successful login. Yesterday I completed the login checking &amp; session storing tasks. 
</p>
<p>
After login, the left menu which shows the &#8216;Login Box&#8217; need to be replaced with a Welcome Message and a logout link. So how can I accomplish this?
</p>
<p>
How can I call a same function which displays this Welcome Message from within all classes ?
</p>
<p>
I am waiting here to hear from you all..
</p>
<p>
Thank You,
<br />
Php Developer.
</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>Pagination problems</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/89562/" />      
      <id>tag:codeigniter.com,2008:forums/viewthread/.89562</id>
      <published>2008-08-29T11:29:56Z</published>
      <updated></updated>
      <author><name>buckboru</name></author>
      <content type="html">
      <![CDATA[
        <p>Hi, 
<br />
I have been looking at examples of using pagination.&nbsp; I am trying to implement this but i&#8217;m having some issues.&nbsp; Basically i get an error on this 
<br />
$config[&#8217;total_rows&#8217;] = $this-&gt;db-&gt;count_all(&#8217;tstmis.phoned01&#8217;);
<br />
saying that  Call to a member function count_all() on a non-object
</p>
<p>
This is what my controller looks like 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">Phonelist </span><span style="color: #007700">extends </span><span style="color: #0000BB">Controller<br />&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">index</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//this gives us redirect<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// load pagination class<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'pagination'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'base_url'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">base_url</span><span style="color: #007700">().</span><span style="color: #DD0000">'index.php/phonelist/list_users/'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'total_rows'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">count_all</span><span style="color: #007700">(</span><span style="color: #DD0000">'tstmis.phoned01'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'per_page'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'5'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'full_tag_open'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'&lt;p&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'full_tag_close'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #DD0000">'&lt;/p&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagination</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">redirect</span><span style="color: #007700">(</span><span style="color: #DD0000">'phonelist/list_users'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">list_users</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">database</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">(</span><span style="color: #DD0000">'phone_model'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'phonelist'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">phone_model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_phonelist</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// This gives us anchor() - see the view at the end<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">(</span><span style="color: #DD0000">'phonelist_view'</span><span style="color: #007700">, </span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">view_job</span><span style="color: #007700">(</span><span style="color: #0000BB">$id </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!</span><span style="color: #0000BB">$id</span><span style="color: #007700">) </span><span style="color: #0000BB">redirect </span><span style="color: #007700">(</span><span style="color: #DD0000">'jobs/list_jobs'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">database</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">(</span><span style="color: #DD0000">'jobs_model'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'jobs'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">jobs_model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_job</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">(</span><span style="color: #DD0000">'job_view'</span><span style="color: #007700">,</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&#125;</span>
</code></div><p>
Below works fine in my model 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">$query </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get</span><span style="color: #007700">(</span><span style="color: #DD0000">'tstmis.phoned01'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach (</span><span style="color: #0000BB">$query</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">result_array</span><span style="color: #007700">() as </span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result&#91;&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$row</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return </span><span style="color: #0000BB">$result</span><span style="color: #007700">;</span>
</code></div><p>
Any ideas?
</p>
<p>
Thanks
</p>
      ]]>
      </content>
    </entry>


</feed>