select count(*) > @foobar

From: - (nobody_at_hoem.om)
Date: 01/31/05


Date: Mon, 31 Jan 2005 09:50:45 +0800

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

$result = mysqli_query("SELECT 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.



Relevant Pages

  • newbie :-sending variable value between two scripts...
    ... I am having some problems with my PHP and MySQL, basically, I need to ... #Enter Survey Author... ... #execute query ...
    (php.general)
  • PHPs MySQL Query Length Limit? (Long SQL failing!)
    ... I've been doing PHP for a pretty good while now, ... Then I go and use it with a mysql query. ... The query is written correctly AKAIK, but no data reaches the table I'm ... The only difference between queries that work and those that do not ...
    (php.general)
  • Re: Dynamic form generation for editing mysql data
    ... I hope this is the right place to post my query. ... to php and MySQL (but have been programming in C++/python for a few ... regarding editing MySQL data using a form. ... the format of the data in the database. ...
    (comp.lang.php)
  • Re: Reducing load for LAMP app?
    ... Not from PHP, there isn't. ... Just like every program running in a system is considered independent. ... the MySQL query cache may be more efficient. ...
    (comp.lang.php)
  • Re: I am totally stumped..with this on..LOAD_FILE Mysql+PHP= FSCK!!
    ... What I am trying to do is to upload files and stuff them in a mysql database. ... I copied the temporary file to somewhere else, and then handed it to MySQL..THAT WORKED.. ... Is there a way to force a close on the file..maybe that's the problem Mysql is opening a file that is not flushed to disk maybe? ... I gew the feeling its maintaining its own picture of file objects, and doesn't actually flush to the disk unless you do a copy or close php.. ...
    (comp.lang.php)