Re: Table shows even when if () is false

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ah, I see.

Changed and working.

Thanks Jay!


On 8/22/07, Jay Blanchard <jblanchard@xxxxxxxxxx> wrote:
>
> [snip]
> [snip]
> $deferred_comments= "SELECT * FROM comments WHERE credit_card_id =
> '$credit_card_id' AND request_type = 'D'";
> $result_deferred_comments = mssql_query($deferred_comments) or
> die(mssql_error());
>
> if(!empty($result_deferred_comments)) {
> [/snip]
>
> $result_deferred_comments is not empty, a query resource was returned.
> To see this;
>
> echo $result_deferred_comments;
>
> What you want to do is something like this;
>
> $num_Deferred_Comments = mysql_num_rows($result_deferred_comments);
>
> if(0 != $num_Deferred_Comments)) {....
> [/snip]
>
> My bad, just noticed you were using mssql, so use the proper functions
> there, like mssql_num_rows
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux