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

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

Yeah so that doesn't seem to work.

Help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.