Re: Big problem....need help

From: Date: Wed, 09 Jul 2003 18:19:39 +0000
Subject: Re: Big problem....need help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-154607@lists.php.net to get a copy of this message
10x a lot. it worked. Now I have another problem. How to find the number of the records in the table. this is the way i want (in this case} Name: aaa 2 times Name ddd 1 times Please help with this one ----- Original Message ----- From: Haseeb To: phpu@go.ro ; nicolas.costes@iut-laroche.univ-nantes.fr Cc: php-general@lists.php.net Sent: Thursday, July 10, 2003 8:18 AM Subject: Re: [PHP] Big problem....need help try like this $sql = "SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=".$_GET['category_id']." GROUP BY products.mark_name"; -------Original Message------- From: phpu Date: Wednesday, July 09, 2003 09:51:08 PM To: nicolas.costes@iut-laroche.univ-nantes.fr Cc: php-general@lists.php.net Subject: Re: [PHP] Big problem....need help It isn't work. it gives me an error at this line. ----- Original Message ----- From: "Nicolas Costes" <nicolas.costes@iut-laroche.univ-nantes.fr> To: <php-general@lists.php.net> Sent: Wednesday, July 09, 2003 4:49 PM Subject: Re: [PHP] Big problem....need help -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Mercredi 9 Juillet 2003 15:13, phpu a écrit : > I have a table like this: > ...... > $sql = "SELECT * FROM products, category WHERE > category.name_category=products.name_category and > category_id=".$_GET['category_id'] ; > > When i choose the category catg 1 the result is > Name: aaa > Name: aaa > Name: ddd > > As you can see the name aaa appears 2 times insted 1. > How to make the result look like this: > Name: aaa > Name: ddd Use "GROUP BY" .... $sql = "SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=".$_GET['category_id'] GROUP BY products.mark_name; - -- ,, (°> Nicolas Costes /|\ IUT de La Roche / Yon ( ^ ) Clé publique: http://www.keyserver.net/ ^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ OgayWbAh0cOXc5OCdVy2uWs= =vH6U -----END PGP SIGNATURE----- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ____________________________________________________ IncrediMail - Email has finally evolved - Click Here

« previous php.general (#154607) next »