Basically, this is telling you that there is no such function as
"Sqlite3::numRows". I did a fast scan of the sqlite3 documentation, and
there does not appear to be a sqlite3 function which returns this type of
information. The PHP interface appears to just be a wrapper for PHP around
existing sqlite3 calls, and since sqlite3 does not implement this function,
neither does the PHP interface.

>From my looking, such as it was, I would say that you need to either do a
$result->fetcharray(), then see how big that array is. Or, if you don't
really want the data, do a
$result=$db->query("select count(*) as numRows from table");

if you just want a count. Lastly, if you need to check the number of rows
without fetching them, then you'll need to run both queries.

Again, the above is "as best as I can tell". I am not a PHP expert.


On Sun, Sep 22, 2013 at 10:50 PM, pisey phon <phonpise...@gmail.com> wrote:

> Dear Sqlite Team
>
>
> I have some problem with Sqlite3.
>
>
> Would you mind if I want to ask you a question?
>
>
> I got an error "Call to undefined method SQLite3Result::numRows()". and
> here
> is my code:
> $db = new Sqlite3("sample.db");
> $result = $db->query("select * from table");
> $rows = $result->numRows();
>
>
> Please help me. Thanks in advance.
>
>
> Pisey Phon
> Junior Web Developer.
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/Problem-with-method-numRows-in-Sqlite3-tp71420.html
> Sent from the SQLite mailing list archive at Nabble.com.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
As of next week, passwords will be entered in Morse code.

Maranatha! <><
John McKown
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to