select count(*) > @foobar

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

    #1

    select count(*) > @foobar

    i have a query as follows and is unsure whether it is mysql or php:

    $result = mysqli_query("S ELECT COUNT(*) > @foobar AS status ....") where
    it's suppose to get a one row value of either '0' or '1' (false or true)

    if i were to do a SELECT COUNT(*) FROM...
    i can use the php $row["COUNT(*)"] to refer to the index.

    if i were to do a SELECT COUNT(*) AS status FROM...
    i can use the php $row["status"] to refer to the index.

    but in this case SELECT count > @foobar AS status,
    refering to $row["status"] gives a empty value. however, running the
    same query in mysql command prompt produces

    +------+
    |status|
    +------+
    | 1 |
    +------+

    php doesn't support such select statement? even array_keys($row ) returns
    empty.

    anybody knows how to solve it? thank you very much. my apologies for
    posting in here as i didn't ge a response over at php newsgroup.
Working...