Return to Snippet

Revision: 64559
at August 22, 2013 18:40 by brownrl

Initial Code

\$q = "SELECT COUNT( * ) AS total FROM ${1:table} WHERE ${2:field} = '".${3:value}."'";
\$qr = dbQuery( \$q );
\$qrow = dbFetchArray( \$qr );
\$total = \$qrow['total'];

  <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
  <!-- Optional: Set a scope to limit where the snippet will trigger -->
  <!-- <scope>source.python</scope> -->

Initial URL

Initial Description
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.

Initial Title
Sublime Snippet: dbNumRows

Initial Tags
sql, php

Initial Language