Subject Re: [firebird-php] Re: Empty Result Set
Author Dan Wilson
On 12/28/2004 at 9:00 PM troth1871 wrote:

>
> This feature would be very helpful, indeed. I use a standard while
> constructions like this one:
>
> $result = ibase_query ( $fbirdlink, $sql);
> if ($result)
> { print "....";
>
> while ($this_result = ibase_fetch_row ($result))

Try this instead:

while (($this_result = ibase_fetch_row($result)) != false)



> {
> $ID=$this_result[0];
> $VAR1=$this_result[1];
> $VAR2=$this_result2];
> print "This is a
> test!".$ID."#".$VAR1."#".$VAR2;
> }
> print "</ul>\n";
> }
> else
> {
> print "<br>DBMS error or no lines have been
> selected<br>\n";
> }
>
> The problem with this construction is, that Firefox returns unlike
> MySQL a result, even if this result set is empty. There are some
> methods to solve this problem, for example you can make a second
> ibase_query before you make the original select statement and count
> the results and then decide to make the original select statement or
> not.
>
> But this solution isn't very - how should I call it? - nice. There
> must be a more elegant solution for solving this problem.
>
> As you maybe can see I do not have much experience in programming
> PHP and working with Firefox, so I hope you can excuse those dumb
> questions which could sound trivial to you, as well as my terrible
> english.
>
> Regards,
> Thomas
>