Re: [bug] WHERE thing != ''
| From: | Yann Buril | Date: | Tue, 30 May 2000 09:55:00 +0000 |
| Subject: | Re: [bug] WHERE thing != '' | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-19744@lists.php.net to get a copy of this message | ||
the apache error_log file :
[Tue May 30 11:38:38 2000] [notice] child pid 12284 exit signal Segmentation
fault (11)
the URL which brings about the previous line is :
http://voyagepromo.ensmp.org/result.php
you can check the configuration here :
http://voyagepromo.ensmp.org/phpinfo.php
the source of the page is the following :
<html><body bgcolor="#ffffff">
<?php
$db = mysql_connect("localhost","web","**********");
mysql_select_db("x96buril",$db);
$i=0;
$r=mysql_query("select count(*) from sondage where vote1 != ''");
$total = mysql_result($r,0,"count(*)");
$result=mysql_query("select vote1,count(*) from sondage where vote1 != ''
group by vote1 ORDER BY 'count(*)' DESC");
while($myrow=mysql_fetch_array($result)) {
$i++;
echo "<b>".$i."</b>
".$myrow["vote1"]."<br>";
}
?>
</body>
</html>
and the database :
mysql> describe sondage;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| prenom | varchar(255) | | | | |
| nom | varchar(255) | | | | |
| login | varchar(255) | | | | |
| vote1 | varchar(255) | | | | |
(...)
Hope it helps :-)
Yann
----- Original Message -----
From: "Stanislav Malyshev" <stas@zend.com>
To: "Manuel Lemos" <mlemos@acm.org>
Cc: "Yann Buril" <yann.buril@m4x.org>; <php-dev@lists.php.net>
Sent: Tuesday, May 30, 2000 11:34 AM
Subject: Re: [PHP-DEV] [bug] WHERE thing != ''
> ML>> >So it is not possible to select a non-empty string with the new
release...
> ML>>
> ML>> SQL is not C or PHP . In SQL different is <>, not != .
>
> Not true. In MySQL, != is acceptable and analogous to <>.
>
>
> --
> Stanislav Malyshev stas@zend.com
> +972-3-6139665
>
>