hi and thank you,
is there a reason this will not work? i am trying to echo an
option that has already been selected in a list menu. best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
addison@bellsouth.net
info@smipco.com
subsidiaries of small independent publishing co.
info@gloabaldog.com
info@momandpocentral.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: select
am 03.02.2003 13:39:57 von Maxim Maletsky
Yes,
>
RE: Select
am 17.05.2005 08:17:43 von jjuffermans
Hi,
Instead of doing a SELECT *, specify the fields that you require. Allthough
you may think the rows are exactly the same, one might be empty ("") and one
null which is not the same.
You are more likely to get the result that you need if you specify the
fields:
SELECT DISTINCT somedata, rev, andthis FROM rev ORDER BY rev
By the way, having "rev" as a name for your table AND as a fieldname is
confusing and not advisable.
Rgds,
Jos
-----Original Message-----
From: MIGUEL ANTONIO GUIRAO AGUILAR
[mailto:miguel.guirao@mail.telcel.com]
Sent: 17 May 2005 04:26
To: php-db@lists.php.net
Subject: [PHP-DB] Select
Hi!!
I have this query in PHP:
$items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY rev", $link);
I have three rows with the same data on it, and DISTINCT seems to be not
working, since I got all the rows, any ideas of what is going wrong?
--------------------------
MIGUEL GUIRAO AGUILERA
Logistica R8 - Telcel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
In either case you probably can't use SELECT * - you have to specify
the columns you're after. This is because these commands will look
for any differences and if they see one they'll give you a new row;
if all you're after is the userID use SELECT DISTINCT userID ...
this will only return a particular value once.
See the documentation for your particular DBMS; GROUP BY is the more
powerful with all kinds of aggregate functions available but sounds
like SELECT DISTINCT will work fine for what your after.
Good Luck,
Frank
On Dec 10, 2005, at 5:02 PM, php-db-digest-help@lists.php.net wrote:
> From: "Ron Piggott (PHP)"
> Date: December 10, 2005 5:04:28 PM PST
> To: PHP DB
> Subject: SELECT
> Reply-To: ron.php@actsministries.org
>
>
> I am trying to put together a SELECT syntax. I am querying a response
> database and I only want to obtain each user's name once even if they
> have given more than 1 response.
>
> $query="SELECT * FROM conversation_table WHERE
> conversation_reference =
> $conversation_currently_displayed";
>
> $response_created_by = mysql_result($result,$i,"response_created_by");
>
> My ideal is that if users 1, 2, 4 & 5 are in dialogue with each other
> the above SELECT $query will only give the results of their identity
> once with the mysql_request() function
>
> Thanks for your help.
>
> Ron
>