php-db | 2001011
Date: 01/11/01
- Next message: simon: "Re: [PHP-DB] Easy MySQL question"
- Previous message: simon: "Re: [PHP-DB] Easy MySQL question"
- In reply to: simon: "Re: [PHP-DB] Easy MySQL question"
- Next in thread: simon: "Re: [PHP-DB] Easy MySQL question"
- Reply: simon: "Re: [PHP-DB] Easy MySQL question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
simon wrote:
> Julie Meloni wrote:
>
>
>> 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(*)");
>>
>
>
> Shouldn't this be $query also?
>
> $query = "SELECT count(*) FROM Movie";
> $result = mysql_query(****$sql****, $dbLink);
> $myrow = mysql_result($result);
> echo $myrow;
>
Yes; I wasn't paying attention to that, just the use of the
mysql_result() function.
-- +------------------------------------------------+ | Julie Meloni (julie <email protected>) | | Tech. Director, i2i Interactive (www.i2ii.com) | | | | "PHP Essentials" & "PHP Fast & Easy" | | http://www.thickbook.com/ | +------------------------------------------------+-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: simon: "Re: [PHP-DB] Easy MySQL question"
- Previous message: simon: "Re: [PHP-DB] Easy MySQL question"
- In reply to: simon: "Re: [PHP-DB] Easy MySQL question"
- Next in thread: simon: "Re: [PHP-DB] Easy MySQL question"
- Reply: simon: "Re: [PHP-DB] Easy MySQL question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

