Re: Prepared Statements Rows Selected
| From: | Giff Hammar | Date: | Tue, 24 May 2011 02:04:39 +0000 |
| Subject: | Re: Prepared Statements Rows Selected | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47803@lists.php.net to get a copy of this message | ||
$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 = 'mysql:host=localhost;dbname='.$database;
> $dbh = new PDO($dsh, $username, $password);
>
> $stmt = $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);
> @mysql_select_db($database) or die( "Unable to select database");
> $result=mysql_query($query);
> $num=mysql_numrows($result);
>
>
> Ron
>
> The Verse of the Day
> “Encouragement from God’s Word”
> http://www.TheVerseOfTheDay.info