Re: Re: Database Problems
| From: | tamouse mailing lists | Date: | Tue, 26 Jun 2012 02:46:06 +0000 |
| Subject: | Re: Re: Database Problems | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48329@lists.php.net to get a copy of this message | ||
On Mon, Jun 25, 2012 at 7:57 AM, Peter Beckman <beckman@angryox.com> wrote:
> I'll save you some time, it's not the "where 1" part of the query:
>
> mysql> select count(*) from numbers where 3 and num like '1212%';
The only time the where clause fails (rightly so) with a single number
like what is when you do "where 0".
mysql> select count(*) from quotes where 0;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from quotes where 1;
+----------+
| count(*) |
+----------+
| 727 |
+----------+
1 row in set (0.00 sec)
Note that the where clause failing does NOT mean the select failed. It
correctly returned 0 rows.