Re: Re: Easy MySQL question
| From: | Leonard T. Harris | Date: | Fri, 12 Jan 2001 15:10:32 +0000 |
| Subject: | Re: Re: Easy MySQL question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5824@lists.php.net to get a copy of this message | ||
What's wrong with
$number=mysql_num_rows($result);
echo "The total number of rows is $number";
----- Original Message -----
From: Julie Meloni <julie@thickbook.com>
To: Paulson, Joseph V. "Jay" <jay.paulson@viatel.com>
Cc: <php-general@lists.php.net>; <php-db@lists.php.net>
Sent: Thursday, January 11, 2001 11:17 AM
Subject: [PHP] Re: [PHP-DB] Easy MySQL question
> Paulson, Joseph V. \"Jay\" wrote:
>
> > Hello everyone--
> > I've got a easy question that I can't seem to answer for myself. I'm
> > running a query in MySQL and want to know how many entries are in a
table
> > and then echo that out onto a page. I thought this would be easy but I
> > don't know why it's not working. Anyway, here's what I am doing:
> >
> > (open db connection)
> >
> > $query = "SELECT count(*) FROM Movie";
> > $result = mysql_query($sql, $dbLink);
> > $myrow = mysql_result($result);
> > echo $myrow;
> >
>
> $myrow = mysql_result($result,0,"count(*)");
>
>
>
> --
> +------------------------------------------------+
> | Julie Meloni (julie@i2ii.com) |
> | Tech. Director, i2i Interactive (www.i2ii.com) |
> | |
> | "PHP Essentials" & "PHP Fast & Easy" |
> | http://www.thickbook.com/ |
> +------------------------------------------------+
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>