EllisLab Community Forums http://ellislab.com/forums/ EllisLab Community Forums en Copyright 2014 2014-04-23T12:00:30-04:00 SQL : between http://ellislab.com/forums/viewthread/245018/ http://ellislab.com/forums/viewthread/245018/#When:06:17:43Z <p>Bonjour, je veux afficher la liste des clients ajoutés par un utilisateur donnée et entre deux dates d’inscription</p> <p> $this-&gt;db-&gt;select(’*’);<br /> &nbsp; &nbsp; &nbsp; $this-&gt;db-&gt;from(‘clients ‘);<br /> &nbsp; &nbsp; &nbsp; $this-&gt;db-&gt;where(‘ref_utilisateur’,$ref_utilisateur);<br /> &nbsp; &nbsp; &nbsp; $this-&gt;db-&gt;where(‘date_inscription between’ $date1 ‘and’ $date2);<br /> &nbsp; &nbsp; &nbsp; $query =$this-&gt;db-&gt;get();<br /> &nbsp; &nbsp; &nbsp; if($query-&gt;num_rows() &gt; 0)<br /> &nbsp; &nbsp; &nbsp; {<br /> &nbsp; &nbsp; &nbsp; &nbsp; echo $query-&gt;num_rows();<br /> &nbsp; &nbsp; &nbsp; }<br /> &nbsp; &nbsp; &nbsp; else<br /> &nbsp; &nbsp; &nbsp; {<br /> &nbsp; &nbsp; &nbsp; &nbsp; echo 0;<br /> &nbsp; &nbsp; &nbsp; }</p> <p>maisrien ne s’affiche</p> 2014-04-21T06:17:43-04:00 Live chat module http://ellislab.com/forums/viewthread/165946/ http://ellislab.com/forums/viewthread/165946/#When:00:12:54Z <p>Hey guys! </p> <p>I’m wondering if such a thing exists in EE. I need to implement a live chat for direct consumer service on my site, something like : <a href="http://www.websitealive.com/">http://www.websitealive.com/</a></p> <p>Thanks!</p> 2010-08-30T00:12:54-04:00 Tutorial Foreach not working http://ellislab.com/forums/viewthread/238750/ http://ellislab.com/forums/viewthread/238750/#When:14:05:17Z <p>I am trying to work through the CodeIgniter tutorial and my news pages won’t output data from the foreach loop. I get the following messages:</p> <p>A PHP Error was encountered</p> <p>Severity: Notice</p> <p>Message: Undefined variable: news</p> <p>Filename: pages/index.php</p> <p>Line Number: 1<br /> and</p> <p>A PHP Error was encountered</p> <p>Severity: Warning</p> <p>Message: Invalid argument supplied for foreach()</p> <p>Filename: pages/index.php</p> <p>Line Number: 1<br /> This is my model class:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">&lt;?php<br /></span><span style="color: #91f291">class&nbsp;</span><span style="color: #f5f8cc">News_model&nbsp;</span><span style="color: #91f291">extends&nbsp;</span><span style="color: #f5f8cc">CI_Model&nbsp;{<br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">__construct</span><span style="color: #91f291">()<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">database</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">}<br /><br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">get_news</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$slug&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">FALSE</span><span style="color: #91f291">)<br /></span><span style="color: #f5f8cc">{<br /></span><span style="color: #91f291">if&nbsp;(</span><span style="color: #f5f8cc">$slug&nbsp;</span><span style="color: #91f291">===&nbsp;</span><span style="color: #f5f8cc">FALSE</span><span style="color: #91f291">)<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;$query&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">db</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'news'</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #f5f8cc">$query</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">result_array</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">}<br /><br />$query&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">db</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_where</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'news'</span><span style="color: #91f291">,&nbsp;array(</span><span style="color: #FFFFFF">'slug'&nbsp;</span><span style="color: #91f291">=&gt;&nbsp;</span><span style="color: #f5f8cc">$slug</span><span style="color: #91f291">));<br />return&nbsp;</span><span style="color: #f5f8cc">$query</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">row_array</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">}<br /><br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">index</span><span style="color: #91f291">()<br /></span><span style="color: #f5f8cc">{<br />$data[</span><span style="color: #FFFFFF">'news'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">news_model</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_news</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">$data[</span><span style="color: #FFFFFF">'title'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #FFFFFF">'News&nbsp;archive'</span><span style="color: #91f291">;<br /><br /></span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'templates/header'</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$data</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'news/index'</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$data</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'templates/footer'</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">}<br />}&nbsp;</span> </span> </code></div> <p>And my controller:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #91f291">class&nbsp;</span><span style="color: #f5f8cc">News&nbsp;</span><span style="color: #91f291">extends&nbsp;</span><span style="color: #f5f8cc">CI_Controller&nbsp;{<br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">__construct</span><span style="color: #91f291">()<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #91f291">::</span><span style="color: #f5f8cc">__construct</span><span style="color: #91f291">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">model</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'news_model'</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">}<br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">index</span><span style="color: #91f291">()<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;$data[</span><span style="color: #FFFFFF">'news'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">news_model</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_news</span><span style="color: #91f291">();<br /></span><span style="color: #f5f8cc">}<br /><br /><br /></span><span style="color: #91f291">public&nbsp;function&nbsp;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$slug</span><span style="color: #91f291">)<br /></span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;$data[</span><span style="color: #FFFFFF">'news_item'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">news_model</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">get_news</span><span style="color: #91f291">(</span><span style="color: #f5f8cc">$slug</span><span style="color: #91f291">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(empty(</span><span style="color: #f5f8cc">$data[</span><span style="color: #FFFFFF">'news_item'</span><span style="color: #f5f8cc">]</span><span style="color: #91f291">))<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;show_404</span><span style="color: #91f291">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;$data[</span><span style="color: #FFFFFF">'title'</span><span style="color: #f5f8cc">]&nbsp;</span><span style="color: #91f291">=&nbsp;</span><span style="color: #f5f8cc">$data[</span><span style="color: #FFFFFF">'news_item'</span><span style="color: #f5f8cc">][</span><span style="color: #FFFFFF">'title'</span><span style="color: #f5f8cc">]</span><span style="color: #91f291">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'templates/header'</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$data</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'news/view'</span><span style="color: #91f291">,&nbsp;</span><span style="color: #f5f8cc">$data</span><span style="color: #91f291">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">$this</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">load</span><span style="color: #91f291">-&gt;</span><span style="color: #f5f8cc">view</span><span style="color: #91f291">(</span><span style="color: #FFFFFF">'templates/footer'</span><span style="color: #91f291">);<br /></span><span style="color: #f5f8cc">}<br /><br />}&nbsp;</span> </span> </code></div> <p>And the first view:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #91f291">&lt;</span><span style="color: #f5f8cc">h2</span><span style="color: #91f291">&gt;</span><span style="color: #f5f8cc">&lt;?php&nbsp;</span><span style="color: #91f291">echo&nbsp;</span><span style="color: #f5f8cc">$news_item[</span><span style="color: #FFFFFF">'title'</span><span style="color: #f5f8cc">]&nbsp;?&gt;</span><span style="color: #91f291">&lt;/</span><span style="color: #f5f8cc">h2</span><span style="color: #91f291">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #f5f8cc">div&nbsp;id</span><span style="color: #91f291">=</span><span style="color: #FFFFFF">"main"</span><span style="color: #91f291">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #f5f8cc">&lt;?php&nbsp;</span><span style="color: #91f291">echo&nbsp;</span><span style="color: #f5f8cc">$news_item[</span><span style="color: #FFFFFF">'text'</span><span style="color: #f5f8cc">]&nbsp;?&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #91f291">&lt;/</span><span style="color: #f5f8cc">div</span><span style="color: #91f291">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #f5f8cc">p</span><span style="color: #91f291">&gt;&lt;</span><span style="color: #f5f8cc">a&nbsp;href</span><span style="color: #91f291">=</span><span style="color: #FFFFFF">"news/&lt;?php&nbsp;echo&nbsp;</span><span style="color: #f5f8cc">$news_item[</span><span style="color: #FFFFFF">'slug']&nbsp;?&gt;"</span><span style="color: #91f291">&gt;</span><span style="color: #f5f8cc">View&nbsp;article</span><span style="color: #91f291">&lt;/</span><span style="color: #f5f8cc">a</span><span style="color: #91f291">&gt;&lt;/</span><span style="color: #f5f8cc">p</span><span style="color: #91f291">&gt;<br /><br /></span><span style="color: #f5f8cc">&lt;?php&nbsp;</span><span style="color: #91f291">endforeach&nbsp;</span><span style="color: #f5f8cc">?&gt;&nbsp;</span> </span> </code></div> <p>and the second:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #f5f8cc">&lt;?php<br /></span><span style="color: #91f291">echo&nbsp;</span><span style="color: #FFFFFF">'&lt;h2&gt;'</span><span style="color: #91f291">.</span><span style="color: #f5f8cc">$news_item[</span><span style="color: #FFFFFF">'title'</span><span style="color: #f5f8cc">]</span><span style="color: #91f291">.</span><span style="color: #FFFFFF">'&lt;/h2&gt;'</span><span style="color: #91f291">;<br />echo&nbsp;</span><span style="color: #f5f8cc">$news_item[</span><span style="color: #FFFFFF">'text'</span><span style="color: #f5f8cc">]</span><span style="color: #91f291">;&nbsp;</span> </span> </code></div> <p>I hope it isn’t something too stupid!</p> <p>Thanks.</p> 2013-11-04T14:05:17-05:00 Need help regarding disabling cache http://ellislab.com/forums/viewthread/238591/ http://ellislab.com/forums/viewthread/238591/#When:03:25:57Z <p>Hi everyone, I need to know what can I do to disable caching in a web application developed using Java.<br /> Actually, my problem is, when I click on the back button, my site shows data that is outdated.</p> 2013-10-25T03:25:57-04:00 chart graphique http://ellislab.com/forums/viewthread/242813/ http://ellislab.com/forums/viewthread/242813/#When:03:42:24Z <p>Bonjour;<br /> je veux réaliser du chart graphique sous codeigniter mais j’ai pas trouvé un tutoriel simple.<br /> pouvez_vous m’aider??</p> 2014-02-10T03:42:24-05:00 raffraichissement du contenu http://ellislab.com/forums/viewthread/244438/ http://ellislab.com/forums/viewthread/244438/#When:12:26:06Z <p>je veux faire un rafraîchissement automatique de ma page chaque 1000 ms par exemple , <br /> pouvez vous m’aider.<br /> Merci d’avance</p> 2014-03-19T12:26:06-04:00 Comment ajouter des colonnes pour un table générer par la class table et qui contient l’exécution d’une requête select ? http://ellislab.com/forums/viewthread/242812/ http://ellislab.com/forums/viewthread/242812/#When:03:38:55Z <p>voici mon code: je veux ajouter deux colonne pour la suppression et la modification des champs de table?</p> <p>$this-&gt;load-&gt;library(‘table’);<br /> $tmpl = array ( ‘table_open’&nbsp; =&gt; ‘&lt;table border=“1” cellpadding=“2” cellspacing=“1” class=“mytable”&gt;’ );<br /> $this-&gt;table-&gt;set_template($tmpl);<br /> $query = $this-&gt;db-&gt;query(“SELECT * FROM client”);<br /> echo $this-&gt;table-&gt;generate($query);</p> 2014-02-10T03:38:55-05:00 Will money donation save Codeigniter? http://ellislab.com/forums/viewthread/244941/ http://ellislab.com/forums/viewthread/244941/#When:23:50:43Z <p>Hi Ellislab!</p> <p>2 years ago I ran into CI and I couldn’t believe how simple it was!</p> <p>Great framework, great documentation and good support.</p> <p>Of course there was room for improvements but like every other project that needs attention. </p> <p>Anyway what I mean is that it was not too behind from a being a great framework.</p> <p>Last year I heard you guys are giving up on it. </p> <p>Why did you guys give up on CI but not on your other products? Why Express Engine and not CI?</p> <p>You haven’t posted anything about CI for months.</p> <p><b>Do you know how many people globally are using CI? A lot. A lot worth that I think is anything you MUST ASK FROM MEMBERS TO DONATE SOME MONEY TO GET CODEIGNITER BACK TO LIFE BECAUSE IT IS WORTH IT. </p> <p>I HAPPILY DONATE NOTICEABLE AMOUNT TO KEEP CI AROUND.</b></p> <p>I’m warning you, if you give up on CodeIgniter you will never get a threesome with 2 hot chicks.</p> <p>Ben</p> 2014-04-14T23:50:43-04:00 csrf problem http://ellislab.com/forums/viewthread/238737/ http://ellislab.com/forums/viewthread/238737/#When:15:42:58Z <p>Hi,<br /> I’m really stock with csrf in IE and I had no where to go but here.<br /> see this link for complete details.</p> <p><a href="http://stackoverflow.com/questions/19615204/codeigniter-csrf-with-ajax-not-working-in-ie">stackoverflow question</a></p> <p>main idea is that no matter what I do, CSRF won’t work in IE.</p> <p>any help or suggestions?!</p> 2013-11-03T15:42:58-05:00 CodeIgniter Mail Configuration with localhost http://ellislab.com/forums/viewthread/244796/ http://ellislab.com/forums/viewthread/244796/#When:19:22:05Z <p>Hello, <br /> I wrote a code fragment using codeigniter to send mails from localhost(Xampp specifically). It returns a success message but mail is not actually sent. I didn’t do any configuration in php.ini file.<br /> Please I want to know if the mail will be sent when the site is hosted and also if I can get the configuration settings for CI_Mail and php.ini so the mail can be sent in localhost as well as online hosting.</p> 2014-04-04T19:22:05-04:00