You are here: Help with Mysql query « PHP Programming Language « IT news, forums, messages
Help with Mysql query

Posted by Sundin on 11/23/05 03:11

Hi I'm running a sports pool and I'm trying to display stats from the
results of the picks.

The table is 'results' and the fields are 'pick_number', 'game_number',
'user_id', 'points' and 'date'

There is one record for each users' pick. 0 points are given for a loss
and 1-4 points are given for a win. I've already created a query that
gives me the top players by overall points but I'd like to expand that
to include the number of points won just this week, overall winning %
and winning % this week. Can I do this in one query and then display in
an HTML table?

This is what I have so far. Any help is appreciated.

$query = "SELECT user_id, SUM(points) AS points FROM results GROUP BY
user_id ORDER BY points DESC";

 

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация