You are here: MySQL - finding the best buyer / the best buying country, etc. « PHP SQL « IT news, forums, messages
MySQL - finding the best buyer / the best buying country, etc.

Posted by Sιbastien on 03/12/06 01:19

Hi,

I'm working on a website using a PayPal, with a custom PHP/MySQL
(v4.0.17, very unlikely to be able to upgrade for this project) shopping
cart. This is only to let you know about the setup.

Now to my question:

I have a table with transaction informations, in which I have a line for
each transacion, containing a user identifier, their country of
residence, the amount of the transaction, and much more.

I want to be able to tell which user is the best buyer (or maybe the
best 10/20 buyers).
I also want to know which country buys the most.

I've made various pathetic attempts at mixing MAX() and SUM() but to no
avail.

I would really like to have no more than one query for each result, to
make it light on the server, and I also would appreciate to have little
PHP to write, as I think SQL is up to the task.

The amount field is set to varchar(6), but I could change it to a
numerical field if it helps.

I am not a total noob in MySQL, but I really use it with PHP for basic
tasks.

Any help or pointers will be appreciated, even an RTFM if you give me
the page number ;)

SΓ©bastien

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация