0

Ok so I execute a query and am now holding a complete recordset. ($rs_cust)
Now when i check if results are returned and whether I am able to loop through this:

i.e.
While ($row=odbc_Fetch_array($rs_cust))
{Do something}
Now I'd like to have it do something else if there are no results in this array.

i.e
While ($row=odbc_Fetch_array($rs_cust))
{Do something}
else
{Do this}

Is there any way to use a while loop in this functionality?
Or is there an alternative to the while loop that will fit into this structure.

I am unable to count the records using mysql_num_rows because odbc does not have this function. And if there are no records and i set up a counter and if statement within it, they'll be useless because it will never enter the while loop.

Thanks for your help.
Chevy

1
Contributor
2
Replies
3
Views
11 Years
Discussion Span
Last Post by heavychevy
0

I think I figured it out after posting. I can probably do something like this:
While ($row=odbc_Fetch_array($rs_cust))
{Do something}
while (!$row=odbc_fetch_array($rs_cust))
{Do tsomething else}

If there is another solution please let me know.

Thanks
Chevy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.