Checking for EOF (for any rows)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sonnich

    Checking for EOF (for any rows)

    Hi!

    I simply need to check for wtether my SQL request returns any data -
    any row = yes.

    AFAIK there is no other way than:

    // if any row exist
    if(odbc_fetch_r ow($result2))
    {
    bla.....

    BR
    Sonnich

  • Kim André Akerø

    #2
    Re: Checking for EOF (for any rows)

    Sonnich wrote:
    Hi!
    >
    I simply need to check for wtether my SQL request returns any data -
    any row = yes.
    >
    AFAIK there is no other way than:
    >
    // if any row exist
    if(odbc_fetch_r ow($result2))
    {
    bla.....
    >
    BR
    Sonnich
    Since you're using ODBC, why not use odbc_num_rows() ?


    Like this:

    if (odbc_num_rows( $result2) 0) {
    // bla bla bla
    }

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    Working...