On Wed, Apr 30, 2008 at 4:50 PM, Skip Evans <[EMAIL PROTECTED]> wrote:
>  But why did so much documentation I found on the
>  web use numRows()?
>
>  What is the difference between the PDOStatement
>  set of functions and the set to which numRows()
>  belongs to?
>
>  Different versions of SQLite?
>
>  Thanks again,
>  Skip


Which functions are you talking about?  These ones?

http://us3.php.net/manual/en/ref.sqlite.php

They are just different ways of accessing the SQLite Database... PDO
(an abraction layer) vs built in SQLite functions (which are probably
more similar to the actual SQLite c libray...).

// Built in functions
$db = new SQLiteDatabase('test.db');
$db->query( 'DROP TABLE not_pdo' );
$db->query( 'CREATE TABLE not_pdo (id, string)' );
$db->query( 'INSERT INTO not_pdo VALUES ("1","1")' );
$db->query( 'INSERT INTO not_pdo VALUES ("2","2")' );
$db->query( 'INSERT INTO not_pdo VALUES ("3","3")' );
$result = $db->query( 'SELECT * FROM not_pdo' );
echo $result->numRows() . "\n\n";

versus...

// PDO functions
$db = new PDO('sqlite3:test.db');
$db->exec( 'DROP TABLE pdo' );
$db->exec( 'CREATE TABLE pdo (id, string)' );
$db->exec( 'INSERT INTO pdo VALUES ("1","1")' );
$db->exec( 'INSERT INTO pdo VALUES ("1","2")' );
$result = $db->query( 'SELECT * FROM pdo' );
echo $result->rowCount() . "\n\n";

-- 
~Ty
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to