Prepared Statements Rows Selected

------=_NextPart_000_007A_01CC197A.ABFF94E0
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


What command will tell me the # of rows the SELECT query retrieved using =
Prepared Statements.


$dsh =3D 'mysql:host=3Dlocalhost;dbname=3D'.$database;
$dbh =3D new PDO($dsh, $username, $password);

$stmt =3D $dbh->prepare($query);

$stmt->bindParam(':email', $email);
$stmt->bindParam(':pass', $pass);

$stmt->execute();


I am looking for the equivalent of mysql_numrows

mysql_connect('localhost',$username,$password);
[at] mysql_select_db($database) or die( "Unable to select database");
$result=3Dmysql_query($query);
$num=3Dmysql_numrows($result);


Ron

The Verse of the Day
=E2=80=9CEncouragement from God=E2=80=99s Word=E2=80=9D
http://www.TheVerseOfTheDay.info

------=_NextPart_000_007A_01CC197A.ABFF94E0--
ron.piggott [ Di, 24 Mai 2011 00:53 ] [ ID #2059996 ]

Re: Prepared Statements Rows Selected

$stmt->rows() should give you the number of rows returned.

Giff

On Mon, 2011-05-23 at 18:53 -0400, Ron Piggott wrote:
> What command will tell me the # of rows the SELECT query retrieved using =
Prepared Statements.
>
>
> $dsh =3D 'mysql:host=3Dlocalhost;dbname=3D'.$database;
> $dbh =3D new PDO($dsh, $username, $password);
>
> $stmt =3D $dbh->prepare($query);
>
> $stmt->bindParam(':email', $email);
> $stmt->bindParam(':pass', $pass);
>
> $stmt->execute();
>
>
> I am looking for the equivalent of mysql_numrows
>
> mysql_connect('localhost',$username,$password);
> [at] mysql_select_db($database) or die( "Unable to select database");
> $result=3Dmysql_query($query);
> $num=3Dmysql_numrows($result);
>
>
> Ron
>
> The Verse of the Day
> =E2=80=9CEncouragement from God=E2=80=99s Word=E2=80=9D
> http://www.TheVerseOfTheDay.info



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Giff Hammar [ Di, 24 Mai 2011 04:04 ] [ ID #2059997 ]
PHP » gmane.comp.php.database » Prepared Statements Rows Selected

Vorheriges Thema: Dynamic dropdown: where am I wrong?
Nächstes Thema: Query Question