in reply to Re: Don't understand row
in thread Don't understand row

Ok, It was supposed to be $sth. But I don't understand this statement "if($sth->rows() <= 0)".

After fixing all those simple error, I add this code to test it "else{...." and the output is from the else{... where it should be from the if(.....

sorry for my english.

Thanks

Replies are listed 'Best First'.
Re^3: Don't understand row
by Zaxo (Archbishop) on Feb 14, 2005 at 05:15 UTC

    DBI's rows method is supposed to return the number of rows affected by the sql statement after it is executed. That is only meant to work with table-modifying statements, but some drivers may return good results for selects as well.

    That you are seeing the comparison fail means you are getting a positive number from rows. That is what you would expect for a successful query, assuming select $sth's rows works.

    After Compline,
    Zaxo