PHP Mysql Select Distinct problem
| From: | Chris Payne | Date: | Wed, 22 May 2002 14:29:20 +0000 |
| Subject: | PHP Mysql Select Distinct problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19357@lists.php.net to get a copy of this message | ||
Hi there everyone,
I have the following MySQL/PHP code:
$query = "SELECT DISTINCT
property_name,board,standard,description,region,country,state,city,addre
ss,zip,fax,telephone,email,url,image,image_type FROM llm WHERE
property_name LIKE '%$property_name%' OR country LIKE
'%$property_name%' OR city LIKE '%$property_name%' ORDER BY
property_name ASC LIMIT $offset, $item_perpage";
$querytotal = "SELECT count(DISTINCT
property_name,board,standard,description,region,country,state,city,addre
ss,zip,fax,telephone,email,url,image,image_type) FROM llm WHERE
property_name LIKE '%$property_name%' OR country LIKE
'%$property_name%' OR city LIKE '%$property_name%' ORDER BY
property_name ASC";
Which works great BUT there is 1 problem, I need to be able to pull the
value ID from the database at the same time but WITHOUT it being a
DISTINCT value, how can I do this? All the others need to be DISTINCT
apart from ID, i'm very confused.
Thanks for everything.
Regards
Chris Payne
www.planetoxygene.com <http://www.planetoxygene.com/>