PDA

View Full Version : How to align names via points


Ruben Miranda
08-10-2010, 08:26 PM
Hello Everyone
I am new here
So would like to say hello to all
Great place glad I found it.

I am not a pro web designer in fact I still consider my self new.

I am building a web page for a online racing Community.

What I need help with if it can be done
Is there a way
Say there are 20 drivers and as races go on the points change for the drivers
Example:
Driver 1 first race has 10 points
and
Driver 5 has 5 points
the next race
Driver 5 gets 10 points = 15
and
Driver 1 gets 3 points = 13
is there some way a table or some thing that when the points get changed the highest Name points and all get moved to the top as 1sr 2nd 3rd ext ext.

Any help or ideas
Less work the better

Thank you for your time
Ruben M.

DWcourse
08-10-2010, 10:49 PM
You could accomplish this by creating a Spry Dataset table and linking it to an HTML or XML file that you update and reload. But that's probably a bit much to try to explain here.

The other option is php and a database.

Corrosive
08-11-2010, 06:24 AM
You can also sort an array using PHP with sort_numeric I believe. Is your points table database driven?

Ruben Miranda
08-12-2010, 03:27 AM
Hello
Well here is a link to to show what I am thinking and trying to do.
http://usf1racing.com/USF1_Site/USA_Drivers.htm

Maybe you guy know a better way to do this or have a idea on it.

DWcourse Wrote:
You could accomplish this by creating a Spry Dataset table and linking it to an HTML or XML file that you update and reload. But that's probably a bit much to try to explain here.

The other option is php and a database.
What is Spry Data set?
Corrosive Wrote:
You can also sort an array using PHP with sort_numeric I believe. Is your points table database driven?
Sorry I don't know if it is database driven I would say no :-D
Any links or Articals to the above would be great
Thank you for your time

Ruben M.

Corrosive
08-12-2010, 06:27 AM
OK, having looked at the site I agree it isn't database driven. Quick pointer;

You can use a server-side language such as PHP to connect to and interrogate/change a SQL database (which will also sit on your server). Imagine your table that you have created with the race results but sat behind the scenes.

You can write some code in your page to extract that data and display it on your page in the way you have now. You can also ask it to manipulate the data and sort it before it displays it so that it goes in points order.

It will take some learning; http://devzone.zend.com/article/625 but creating dynamic websites is a lot more satisfying than static IMO.

You won't be able to do what you what with HTML alone as it is static and not dynamic.

There may be a way with javascript but I have no idea what it is.

Welcome to 'the learning curve' ;)