/ Published in: PHP
                    
                                        
When using PDO with sQlite ->rowCount() doesn't work. the recommendation is to do a pre query to get the number. Thus, I created this snippet to help things along.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<snippet>
<content><![CDATA[
\$q = "SELECT COUNT( * ) AS total FROM ${1:table} WHERE ${2:field} = '".${3:value}."'";
\$qr = dbQuery( \$q );
\$qrow = dbFetchArray( \$qr );
\$total = \$qrow['total'];
]]></content>
<tabTrigger>dbNumRows</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
URL: http://www.itsgooto.be/cv.php
Comments
 Subscribe to comments
                    Subscribe to comments
                
                