in reply to SELECT COUNT and DBI: rows

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Re: SELECT COUNT and DBI: rows
by Zaxo (Archbishop) on Sep 28, 2003 at 21:02 UTC
    There is no AS in MySQL, but there is in Oracle

    Wrong. MySQL supports 'AS' aliases in SELECT just the way OP uses them.

    After Compline,
    Zaxo

Re: Re: SELECT COUNT and DBI: rows
by Anonymous Monk on Sep 29, 2003 at 04:34 UTC
    Maybe you where thinking of
    select col INTO var ...
Re: Re: SELECT COUNT and DBI: rows
by ronzomckelvey (Acolyte) on Sep 28, 2003 at 21:08 UTC
    OK, I checked it out, AS is valid, but didn't it used to be not-valid syntax? I remember having to use MySQL without the AS after I swtiched from Oracle (a few years ago).

    As for as  $numrows = $sth->rows; not working, it does work, always has worked with MySQL for selects (and I use it in Oracle), the DBI docs suggest you don't use it for compatabilty across different drivers. And yes I do understand it only returns the current row count affected, not the rows in the table (duh)

      ... but didn't it used to be not-valid syntax? I remember having to use MySQL without the AS after I swtiched from Oracle (a few years ago).

      A "few years ago" in internet time is a lifetime. You can save yourself embarrassment by checking current docs before making a "you can't do that" statement, especially on stuff you haven't used for a few years.