snipt

Ctrl+h for KB shortcuts

PHP

How to get max(id) of row data MySql

<?php
$row = $this->db->query('SELECT MAX(id) AS `maxid` FROM `idm_news`')->row();
https://snipt.net/embed/05eb7b42e40a736d7f36b434a362951f/
https://snipt.net/raw/05eb7b42e40a736d7f36b434a362951f/
05eb7b42e40a736d7f36b434a362951f
php
PHP
2
2016-09-25T00:18:47
True
False
True
May 12, 2015 at 05:30 AM
/api/public/snipt/139444/
how-to-get-maxid-of-row-data-mysql-70aa5ab6
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$row</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">db</span><span class="o">-&gt;</span><span class="na">query</span><span class="p">(</span><span class="s1">&#39;SELECT MAX(id) AS `maxid` FROM `idm_news`&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">row</span><span class="p">();</span> </span></pre></div> </td></tr></table>
codeigniter

Markdown

PHP CAPTCHA library for CodeIgniter

The Securimage library - an open-source free PHP CAPTCHA

link https://github.com/abstractcodify/securimage_for_ci

DOC https://www.phpcaptcha.org/

https://snipt.net/embed/011af216de3b4f1ab440dbf953a91f7b/
https://snipt.net/raw/011af216de3b4f1ab440dbf953a91f7b/
011af216de3b4f1ab440dbf953a91f7b
markdown
Markdown
6
2016-09-26T10:31:29
True
False
True
Sep 30, 2014 at 04:45 AM
/api/public/snipt/136624/
php-captcha-library-for-codeigniter-a40f52d2
<p>The Securimage library - an open-source free PHP CAPTCHA </p> <p>link <a href="https://github.com/abstractcodify/securimage_for_ci">https://github.com/abstractcodify/securimage_for_ci</a></p> <p>DOC <a href="https://www.phpcaptcha.org/">https://www.phpcaptcha.org/</a></p>
captcha, codeigniter, php

PHP

Codelgniter Manual Where use OR

1
2
3
4
<?php

$this->db->where( ' ( db_data.date_exp > '. strtotime( 'now' ) . 
                 ' OR db_data.date_exp = 0 ) ', false , false );
https://snipt.net/embed/86b67c234e881d9b0dd37ad11eeb0901/
https://snipt.net/raw/86b67c234e881d9b0dd37ad11eeb0901/
86b67c234e881d9b0dd37ad11eeb0901
php
PHP
5
2016-09-24T18:38:01
True
False
True
Sep 09, 2013 at 04:31 AM
/api/public/snipt/79783/
codelgniter-manual-where-use-or
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">db</span><span class="o">-&gt;</span><span class="na">where</span><span class="p">(</span> <span class="s1">&#39; ( db_data.date_exp &gt; &#39;</span><span class="o">.</span> <span class="nb">strtotime</span><span class="p">(</span> <span class="s1">&#39;now&#39;</span> <span class="p">)</span> <span class="o">.</span> </span><span id="L-4"><a name="L-4"></a> <span class="s1">&#39; OR db_data.date_exp = 0 ) &#39;</span><span class="p">,</span> <span class="k">false</span> <span class="p">,</span> <span class="k">false</span> <span class="p">);</span> </span></pre></div> </td></tr></table>
codeigniter, date
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.