For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2006 > MDB2, MySQL, numRows()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MDB2, MySQL, numRows()
brian

2006-06-28, 6:59 pm

PEAR 1.4.9
MDB2 2.1.0
MDB2_Driver_mysql 1.1.0

numRows: method not implemented[Native code: 0] [Native message: ]

Is this true? Or am i doing this wrong?

-- snip --
$sql = 'SELECT * FROM foo WHERE bar = ?';
$stmnt = $mdb2->prepare($sql, Array('integer'), MDB2_PREPARE_RESULT);
$result = $stmnt->execute($baz);

if (PEAR::isError($result))
{
die('bad result');
}
else
{
$out = $result->numRows();
die($out->getUserinfo());
}
-- snip --

brian
Lukas Smith

2006-06-29, 3:59 am

brian wrote:
> PEAR 1.4.9
> MDB2 2.1.0
> MDB2_Driver_mysql 1.1.0
>
> numRows: method not implemented[Native code: 0] [Native message: ]
>
> Is this true? Or am i doing this wrong?


I presume you set the "result_buffering" option to false?
Without result buffering MDB2 cannot know how many rows there are in the
result set.

regards,
Lukas
brian

2006-06-29, 7:00 pm

Lukas Smith wrote:
> brian wrote:
>
>
>
> I presume you set the "result_buffering" option to false?
> Without result buffering MDB2 cannot know how many rows there are in the
> result set.
>


It looks as if that was precisely the problem. Seems obvious now, of
course. Thanks a bunch, Lukas.

brian
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com